Aktiver Arbeitgeber
Validate an IP Address. Multiple test cases given.
Anonym
I was told not to use Regex so I did this by splitting the IP Address string at each '.' and then processing each of the sub-strings
def check_ip(ip): l = ip.split('.') if len(l) != 4: return False for item in l: try: val = int(item) except ValueError: return False else: if (val 256): return False return True
Verschaffe dir einen Vorsprung bei Chancen und Insider-Tipps, indem du deinem Traumunternehmen folgst.
Erhalte personalisierte Jobempfehlungen und Updates, indem du Suchanfragen startest.