def convert_ip_to_binary(ip_address):
 octets = ip_address.split('.')
 ip_addr_bin = []
 for octet in octets:
  bin_octet = bin(int(octet))
  bin_octet = bin_octet[2:]
  bin_octet = pad_binary_digits(bin_octet)
  ip_addr_bin.append(bin_octet)
 return '.'.join(ip_addr_bin)

def convert_ip_to_binary ( ip_address ) : octets = ip_address . split ( '.' ) ip_addr_bin = [ ] for octet in octets : bin_octet = bin ( int ( octet ) ) bin_octet = bin_octet [ 2 : ] bin_octet = pad_binary_digits ( bin_octet ) ip_addr_bin . append ( bin_octet ) return '.' . join ( ip_addr_bin )
take an ip address in dotted-decimal format and convert it to a dotted-binary output .