<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
// guest
▾
Login
Request Account
[ light ]
// Functions
Functions Quiz
// question 1 of 10
What is printed? def f(x): return x or False ; print(f(True))?
None
False
True
// question 2 of 10
What happens with int(""abc"")?
TypeError
ValueError
NameError
// question 3 of 10
What is printed? def f(x): return x.upper() ; print(f(""hi""))?
hi
HI
Error
// question 4 of 10
What is printed? def f(x): return int(x) ; print(f(""7""))?
7""
Error
7
// question 5 of 10
What is printed? def cube(x): return x**3 ; print(cube(2))?
4
6
8
// question 6 of 10
What is printed? def f(x): return x[0] ; print(f(""abc""))?
b
a
abc
// question 7 of 10
What is printed? def f(a=1,b=2): return a+b ; print(f(5))?
52
7
3
// question 8 of 10
What is printed? def f(a,b): print(a+b) ; f(2,3)?
23
5
Error
// question 9 of 10
What is printed? def add(a
2
b
c): return a+b+c ; print(add(1
// question 10 of 10
What happens if you call an undefined function?
NameError
Nothing
ValueError
Submit Answers →