+ 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

9th Apr 2023, 12:10 AM
Ghassan Sawalha
Ghassan Sawalha - avatar
2 Antworten
+ 6
# First you have to remove „self“ and call: print(validate_IPv4(input()))
9th Apr 2023, 5:16 AM
JaScript
JaScript - avatar
+ 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*
9th Apr 2023, 10:56 AM
Lothar
Lothar - avatar