Engineering 102 TAMU Final Exam Questions
and Answers with Complete Solutions |100% Pass
import my_funcs - ✔✔The following code uses functions defined in my_funcs.py. Complete
the import statement needed at the top of the program.
a=5
print('a ! =', my_funcs.factorial(a)
print('a**2 =', my_funcs.squared(a))
from math import sqrt as sr - ✔✔What statement will rename the function sqrt to sr?
from my_funcs importy factorial - ✔✔my_funcs.py contains definitions for the factorial()
and squared() functions.
What statement imports only the factorial function from my_funcs.py?
def - ✔✔What keyword is used to define a function?
and Answers with Complete Solutions |100% Pass
import my_funcs - ✔✔The following code uses functions defined in my_funcs.py. Complete
the import statement needed at the top of the program.
a=5
print('a ! =', my_funcs.factorial(a)
print('a**2 =', my_funcs.squared(a))
from math import sqrt as sr - ✔✔What statement will rename the function sqrt to sr?
from my_funcs importy factorial - ✔✔my_funcs.py contains definitions for the factorial()
and squared() functions.
What statement imports only the factorial function from my_funcs.py?
def - ✔✔What keyword is used to define a function?