<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// general
General Quiz
// question 1 of 10
What is a class attribute?
An attribute shared by all instances of a class
An attribute defined inside __init__
An attribute unique to each object
// question 2 of 10
What is printed? print((1,2,3)[0])
1
3
2
// question 3 of 10
What is printed? if 3 == 3: print(""OK"")?
Error
OK
Nothing
// question 4 of 10
What does round(3.7) return?
4
3.7
3
// question 5 of 10
What is duck typing in Python?
A method that checks the type before calling
A restriction that only allows certain types as arguments
If an object has the required method it can be used regardless of its type
// question 6 of 10
What is printed? if 3 != 3: print(""OK"")?
Error
Nothing
OK
// question 7 of 10
What does continue do in a while loop?
Starts next iteration
Stops loop
Resets variable
// question 8 of 10
What is printed? a=[1,2,3]
print(a[1:])
[1,2]
[2,3]
// question 9 of 10
What type is the result of 5 / 2?
str
int
float
// question 10 of 10
What is printed? x = 5 ; print(x)?
x
Error
5
Submit Answers →