Question: python please give me the full code including host name and return ip address of host name. 2 3 4 5 6 7 8 9

python
please give me the full code including host name and return ip address of host name. pythonplease give me the full code including host name and return ip

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 The following code has the following format: # are ordinary comments de describe coment lines that you should replacu with Python code that actually does the thing described in that comment. For example: # a typical hello-world program me print out the string "hello world" You would then take the 49 and replace it so that you would then have . a typical hello-world program print("hello world 17 import socket 18 19 ir _name__ 21 * here's where we set the hostname that we want to resolve 22 you may hardcode it or read from command line or standard input 23 * hostname = 24 # return IP address of hostname try: # here's where we get the address based on the hostname * addr = call to the function that resolves the hostname into an address print('Successfully resolved. The IP address of 1s ().format(hostname, addr)) except socket.gaterror as ert: print ("Can't find hostname: "err) except socket. timeout as err: print ("Can't resolve this hostname due to connection timeout: err) 25 26 28 29 30 31 32 33 34

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!