
Python L6
Quiz
•
Computers
•
6th - 8th Grade
•
Practice Problem
•
Medium
Alaa Ahmad
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the __init__ method in a class?
To initialize object attributes.
To print object details.
To compare objects.
To delete objects.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to inherit a class in Python?
extends
inherits
super
No keyword; the class name is specified in parentheses.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Cat:
def sound(self):
return "Meow"
c = Cat()
print(c.sound())
Meow
sound()
None
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Book:
def init(self, title):
self.title = title
b = Book()
What happens when this code runs?
Creates a book with title = None
Raises TypeError (missing title argument)
Automatically sets title = "Untitled"
Skips init
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Car:
def start():
return "Engine on"
c = Car()
print(c.start())
What happens?
Raises TypeError (missing 1 positional argument: self)
Engine on
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a class attribute?
An attribute unique to each instance
An attribute shared by all instances of a class
A private attribute that cannot be accessed
A temporary variable in a method
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?
Similar Resources on Wayground
10 questions
Year 7 ICT Starters On Track Stage 1 - Topic 4: Database
Quiz
•
7th Grade
10 questions
แบบทดสอบบทที่ 7
Quiz
•
8th Grade
15 questions
Spreadsheets and Sports Stats
Quiz
•
7th Grade
14 questions
Apple quiz
Quiz
•
5th Grade - University
15 questions
How to use WhatsApp, Google Meet and Google Classroom
Quiz
•
7th Grade
13 questions
Operating systems
Quiz
•
7th - 10th Grade
15 questions
Networking Quiz
Quiz
•
8th - 9th Grade
10 questions
Revision Quiz 2 - Information Technology
Quiz
•
7th - 8th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
