Question: Q6 python question. Fill in the blanks to complete the function. The identify_IP function receives an IP_address as a string through the functions parameters, then
Q6 python question.
Fill in the blanks to complete the function. The identify_IP function receives an IP_address as a string through the functions parameters, then it should print a description of the IP address. Currently, the function should only support three IP addresses and return "unknown" for all other IPs. -
def identify_IP(IP_address):
if ___ == "192.168.1.1":
IP_description = "Network router"
elif ___ == "8.8.8.8" or ___ == "8.8.4.4":
IP_description = "Google DNS server"
elif ___ == "142.250.191.46":
IP_description = "Google.com"
___:
IP_description = "unknown"
return ___
print(identify_IP("8.8.4.4")) # Should print 'Google DNS server'
print(identify_IP("142.250.191.46")) # Should print 'Google.com'
print(identify_IP("192.168.1.1")) # Should print 'Network router'
print(identify_IP("8.8.8.8")) # Should print 'Google DNS server'
print(identify_IP("10.10.10.10")) # Should print 'unknown'
print(identify_IP("")) # Should Should print 'unknown'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
