Write a Python program in a Linux/UNIX script called myprogram.py. Write a Python program that continuously (i.e., in an infinite loop) asks the user for a number m. At each iteration of the loop, check in parallel whether m is greater than 10, greater than 20, and greater than 30. Make sure that the three comparisons may be performed in parallel (i.e., so that the three outputs can theoretically be printed in any order). Use the smallest number of processes. Make sure you don’t create zombie processes. Use the code below as a template. Use this template: from os import wait,waitpid,fork # write your code here while (True): #make sure to indent this and the next lines m=float(input('Give me a number: ')) # your code here
Write a Python program in a Linux/UNIX script called myprogram.py.
Write a Python program that continuously (i.e., in an infinite loop) asks the user for a number m. At each iteration of the loop, check in parallel whether m is greater than 10, greater than 20, and greater than 30. Make sure that the three comparisons may be performed in parallel (i.e., so that the three outputs can theoretically be printed in any order). Use the smallest number of processes. Make sure you don’t create zombie processes. Use the code below as a template.
Use this template:
from os import wait,waitpid,fork
# write your code here
while (True):
#make sure to indent this and the next lines
m=float(input('Give me a number: '))
# your code here
Step by step
Solved in 3 steps with 1 images