<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Functions
Functions Quiz
// question 1 of 10
What is printed? x=10 ; def f(): print(x+5) ; f()?
105
15
10
// question 2 of 10
What is printed? def f(x): return x[:2] ; print(f(""python""))?
thon
py
pt
// question 3 of 10
What is printed? def f(x): return x//2 ; print(f(5))?
2
3
2.5
// question 4 of 10
What is printed? def square(x): return x*x ; print(square(3))?
6
9
33
// question 5 of 10
What is printed? try: print(10/2) except ZeroDivisionError: print(""Err"")?
5.0
Err
5
// question 6 of 10
What value does x have? x=5 ; def f(): x=2 ; f() ; print(x)?
2
Error
5
// question 7 of 10
What is printed? try: print(""A"") finally: print(""B"")?
A
B then A
A then B
// question 8 of 10
What happens if you divide by zero inside try?
Program always stops
Nothing happens
except can handle it
// question 9 of 10
What is printed? try: print(""A"") finally: print(""Done"")?
A then Done
Done
A
// question 10 of 10
What is printed? x=5 ; def f(): print(x) ; f()?
Error
None
5
Submit Answers →