<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Functions
Functions Quiz
// question 1 of 10
What is printed? def add(a
b
2
c): return a+b+c ; print(add(1
// question 2 of 10
What is printed? x=1 ; def f(): global x ; x=3 ; f() ; print(x)?
1
Error
3
// question 3 of 10
What is printed? def f(x): return x == 5 ; print(f(5))?
False
5
True
// question 4 of 10
What is printed? def f(x): return x != 0 ; print(f(0))?
True
0
False
// question 5 of 10
What is printed? def f(x): return bool(x) ; print(f(0))?
True
0
False
// 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? def cube(x): return x**3 ; print(cube(2))?
8
4
6
// question 8 of 10
What is printed? def f(x): return x//2 ; print(f(5))?
2
2.5
3
// question 9 of 10
What is printed? def f(a,b): return a or b ; print(f(False,True))?
True
False
Error
// question 10 of 10
What is printed? def f(x): return x%2==0 ; print(f(5))?
5
True
False
Submit Answers →