Answer to Question #255154 in Python for shishi

Question #255154

The Airplane always needs to check with the Airport to see if it has an

available runway before it's able to take off or land. Simulate the above-

mentioned scenario using multi-threading. IN python



1
Expert's answer
2021-10-22T16:47:40-0400
import thread
import time


def checkRunway(name, runway):
    if(runway>0):
        print("There is available runway")
    else:
        print("There is no available runway")
   
n1=int(input("Enter nuber of available runway: "))
n2=int(input("Enter nuber of available runway: "))
try:
   thread.start_new_thread( checkRunway, ("Thread 1", n1) )
   thread.start_new_thread( checkRunway, ("Thread 2", n2) )
except:
   print ("Error:")


while 1:
   pass

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS