9 lines
229 B
Python
9 lines
229 B
Python
|
|
|
||
|
|
def validar_ip (ip : str) -> bool:
|
||
|
|
octetos = ip.split(".")
|
||
|
|
if len(octetos) != 4:
|
||
|
|
return False
|
||
|
|
for octeto in octetos:
|
||
|
|
if int (octeto) < 0 or int(octeto) > 255:
|
||
|
|
return False
|
||
|
|
return True
|