<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
// guest
▾
Login
Request Account
[ light ]
// general
General Quiz
// question 1 of 10
What is encapsulation?
Controlling access to an object's data through methods
Storing all classes in one file
Making all attributes public
// question 2 of 10
What is the output of print(type(Animal()))?
The string representation of Animal
The memory address of the object
The class type of the object
// question 3 of 10
What does else do?
Runs code if condition is False
Stops the program
Creates variables
// question 4 of 10
What does and do?
True if both are True
Reverses value
True if one is True
// question 5 of 10
What is printed? def f(x): return int(x) ; print(f(""7""))?
7
Error
7""
// question 6 of 10
What does if do?
Checks a condition
Repeats code
Imports modules
// question 7 of 10
What does replace() do?
Adds numbers
Deletes text
Replaces text
// question 8 of 10
What does the 'r' mode guarantee when opening a file?
The file is overwritten
The file is created if it does not exist
The file is read only and not modified
// question 9 of 10
What is printed? s={1,2}
s.add(3)
print(s)
{1,2,3}
// question 10 of 10
What is a local variable?
Constant value
Exists everywhere
Exists only inside function
Submit Answers →