<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Functions
Functions Quiz
// question 1 of 10
What happens if you call an undefined function?
NameError
Nothing
ValueError
// 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(): return [1
3] ; print(len(f()))?
3
2
// question 4 of 10
What is printed? try: print(""A"") except: print(""B"")?
A
Error
B
// question 5 of 10
What is printed? def f(a,b): return a+b ; print(f(2,3))?
5
23
None
// question 6 of 10
Can a function call another function?
Yes
Only with import
No
// question 7 of 10
What is printed? def f(x): return x*3 ; print(f(4))?
43
7
12
// question 8 of 10
What is printed? def greet(name): return ""Hi ""+name ; print(greet(""Ana""))?
Error
Hi Ana
Ana Hi
// question 9 of 10
What is printed? try: print([1,2][5]) except IndexError: print(""Index"")?
Error
Index
5
// question 10 of 10
What happens if you divide by zero inside try?
Nothing happens
except can handle it
Program always stops
Submit Answers →