
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
15 questions
S2 Business Letters Assessment
Quiz
•
7th Grade
10 questions
Internet services-Venesha
Quiz
•
3rd - 6th Grade
9 questions
Introduction To Python
Quiz
•
6th - 8th Grade
12 questions
PacMan programming mini test
Quiz
•
6th Grade
10 questions
Blue Cross Websites
Quiz
•
7th Grade
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
15 questions
การเขียนโปรแกรมภาษา
Quiz
•
8th - 9th Grade
10 questions
Photography project
Quiz
•
3rd - 6th 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
