Question: 4) Executing imported modules that is executable itself. Create two modules (Q4_fabonacci.py and Q4_test_facbonacci.py) For the facbonacci.py, enter the following codes and run it (no
4) Executing imported modules that is executable itself. Create two modules (Q4_fabonacci.py and Q4_test_facbonacci.py) For the facbonacci.py, enter the following codes and run it (no import) def fib(n): a, b = 0, 1 while b < n: print(b, end=" ") (a, b) = (b, a + b) # testing if __name__ == '__main__': fib(500) For the Q4_test_facbonacci.py , enter the following codes and run it. import fibonachhi as f print(' import fibonacci as f and run it') f.fib(500)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
