You can use this:
ip = '1.2.3.4' '.'.join(i.zfill(3) for i in ip.split('.')) '001.002.003.004'
2.1m questions
2.1m answers
60 comments
57.0k users