Python: Remove leading zeros from an IP address
Python Regular Expression: Exercise-16 with Solution
Write a Python program to remove leading zeros from an IP address.
import re ip = "216.08.094.196" string = re.sub('\.*', '.', ip) print(string)
Visualize Python code execution:
The following tool visualize what the computer is doing step-by-step as it executes the said program:
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?