<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Functions
Functions Quiz
// question 1 of 10
What does as do in except Exception as e?
Imports modules
Stores the error in a variable
Stops errors
// question 2 of 10
What is printed? def a(): return 2 ; def b(): return a()+1 ; print(b())?
3
21
Error
// question 3 of 10
What does return do?
Sends a value back
Prints automatically
Stops Python
// question 4 of 10
What is a local variable?
Exists everywhere
Exists only inside function
Constant value
// question 5 of 10
What is printed? def f(x): if x>0: return ""P"" else: return ""N"" ; print(f(1))?
1
N
P
// question 6 of 10
What is printed? try: print(5/0) except: print(""Err"")?
Error
Err
0
// question 7 of 10
What is printed? try: print(1/0) except: print(""Err"") finally: print(""Done"")?
Done
Error
Err then Done
// question 8 of 10
What is printed? def square(x): return x*x ; print(square(3))?
9
6
33
// question 9 of 10
What is printed? def f(a,b): print(a+b) ; f(2,3)?
23
Error
5
// question 10 of 10
What is printed? def f(a,b=2): return a+b ; print(f(3))?
Error
5
3
Submit Answers →