+ 1
Write the function isValid to Validate an IPv4 Address. The function takes the address in the form of string and returns true.
Write the function isValid to Validate an IPv4 Address. The function takes the address in the form of string and returns true if this is a valid address otherwise returns false. Print suitable message when calling the function. Note: A valid IPv4 Address consists of four decimal numbers, each ranging from 0 to 255, separated by dots. #How can i Change on this code to recieve the IPv4 address as string and get the write answer? https://code.sololearn.com/cQD1oM294OUr/?ref=app
2 Answers
+ 6
# First you have to remove âselfâ and call:
print(validate_IPv4(input()))
+ 6
aGhassan Sawalha ,
you should also remove the space before:
* def validate_IPv4(self, IP: str) -> str:*
^
since this is seen as an unexpected *indentation*