Question: ex00.py ex01.py ex01b.py please answer the questions by numbering them.so I can understand clearly. Step1: Open ex01.py and run it with a parameter less than

ex00.py

ex01.py

ex01b.py

please answer the questions by numbering them.so I can understand clearly.
Step1: Open ex01.py and run it with a parameter less than 1000 (exp: Ubuntu$ python ex01.py 900), and then more than 1000. Q1. What is the problem? Step2: Run exO1b.py with a large number (more than 1000). Use vmstat and mpstat to check the CPU behaviour. Q2. Explain what is happening. Step3: Remove line 14 (the print call) and then run the program. Q3. Analyse the behavior now. Step4: Run both ex00.py and exolb.py simultaneously, and use vmstat and mpstat to monitor what is going on ex00.py ex00.py 1 while True: 2 pass 3 ex01.py ex01.py 1 import sys 2 3 def factorial(n): 4 if n == 0: 5 return 1 6 else: 7 return n * factorial(n-1) 8 9 if name '__main__': 10 big_number = int(sys.argv[1]) 11 12 for i in range(1, big_number+1): 13 print "factorial(%d)"%(i) 14 factorial(i) 15 exO1b.py ex01b.py 1 import sys 2 3 def factorial(n): 4 num = 1 5 while n >= 1: 6 num = num * n 7 n = n - 1 8 return num 9 10 if _name__ '_main__': 11 big_number = int(sys.argv[1]) 12 13 for i in range(1, big_number+1): 14 print "factorial(%d)"%(i) 15 factorial(i) 16 f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
