描述 To give you an IP address, it may be dotted decimal IP address, it may be 32-bit binary IP address. Is now required to give you an IP address, if the IP address is in dotted decimal output is 32-bit binary IP address,On the contrary, the outpu…
下面是某个字符串是否为IP地址import re def isIP(str): p = re.compile('^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$') if p.match(str): return True else: return FalsemyStr = "10.69.36.95"if isIP(myStr): print(myStr,"it is a IP!"…