Want to test your coding prowess? Take this Python classes and objects quiz in order to see how good you actually are at Python and coding. Who knows, you might even learn something new! Python is a high-level, general-purpose programming language made to aid in the creation of both large and small-scale projects. It also emphasizes code readability through the use of an extensive indentation format. Share the quiz with your friends once you are done taking it so they can test themselves as well! All the best!
PrintHello() is a function and a is a variable. None of them are objects.
Both printHello() and a refer to the same object.
PrintHello() and a refer to different objects.
Syntax error! You cannot assign function to a variable in Python.
A = 10 a = 30
A = 10
A = 20
A = 30
A class is blueprint for the object.
You can only make a single object from the given class.
Both statements are true.
Neither statement is true.
Python
Line
Java
Java Python
Initializes the class for use.
This function is called when a new object is instantiated.
Initializes all the data attributes to zero when called.
None of the above.
0 0
1 1
None None
X y
class Foo: Pass
class Foo(object): pass class Hoo(object): pass
class Foo: pass class Hoo(Foo): pass
None of the above code.
Multilevel Inheritance
Multiple Inheritance
Hierarchical Inheritance
Python Inheritance
In Python, same operator may behave differently depending upon operands.
You can change the way operators behave in Python.
Special method __add()__ is called when + operator is used.
All of the above.
2 2
4 6
0 0
1 1
Wait!
Here's an interesting quiz for you.