Remove zeros from an IP address. 

In this program, we will take a string of IP address as input and remove zeros from an IP address. 

Steps to solve the program
  1. Take a string of an IP address as input.
  2. Import re library.
  3. Remove zeros from the IP address using re.sub().
  4. Print the output.

Output :

calculate the sum of digits of a given string.

find the maximum length of consecutive 0’s in a given binary string

Leave a Comment