Question: python 2 The following code has the following format: 3 # are ordinary comments 4 He describe coment lines that you should replace with Python

python
python 2 The following code has the following format: 3 # are

2 The following code has the following format: 3 # are ordinary comments 4 He describe coment lines that you should replace with Python code that actually does the thing described in that comment. 5 6 For example: 7 8 a typical hello-world program 9 me print out the string "hello world" 10 11 You would thon take the #9 and replace it so that you would then have 12 13 . a typical hello-world program 14 print("hello world 15 16 17 import socket 18 19 ir name_- 20 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 He 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.galerror as er: print ("Can't find hostname: ", orr) except socket. timeout as er: print ("Can't resolve this hostname due to connection timeout: err) 25 26 27 28 29 30 31 32 33

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!