
Python Advance Quiz
Authored by Adam Gijebi
Computers
Professional Development
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the output be?
Sound
Bark
None
Error
Answer explanation
Dog overrides Animal's speak() method, so a.speak() calls the one in Dog.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this code demonstrate?
Method overloading
Method overriding
Polymorphic inheritance
Encapsulation
Answer explanation
That code demonstrates method overriding and inheritance in object-oriented programming.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What's the result of this execution?
1 then 2
1 then StopIteration
1 then Error
Error at first next()
Answer explanation
When a generator hits a return, it raises StopIteration(return_value). Second next() causes an error unless caught.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will this print?
D B A
D B C A
D C B A
D B C A
Answer explanation
Python uses MRO (Method Resolution Order) — it walks B → C → A.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the df.dropna() method do?
Fills missing values with 0
Drops duplicate values
Removes rows with any missing values
Replaces NaNs with "NA"
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does a Python decorator do?
Makes code more readable
Wraps a function to extend or alter its behavior
Encrypts a function
Converts a function into a method
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the super() function do in Python?
Defines a superclass
Accesses the base class's methods or properties
Returns the name of the superclass
Creates an instance of the parent class
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?