
Python L6

Quiz
•
Computers
•
6th - 8th Grade
•
Medium
Alaa Ahmad
Used 1+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
9 questions
Objective 1.01: Interest, attitudes, and Values

Quiz
•
6th - 8th Grade
10 questions
HTML Audio

Quiz
•
8th - 12th Grade
11 questions
Class-VIII Subject: Computer (Monthly Test)

Quiz
•
8th Grade
15 questions
Cloud Computing Quiz-3 Class 8

Quiz
•
8th Grade
13 questions
Code.org: Unit 1 Lesson 1 - 3

Quiz
•
7th - 10th Grade
10 questions
SDA Review Questions 41- 50

Quiz
•
7th Grade
10 questions
HTML Quiz-1

Quiz
•
6th - 12th Grade
11 questions
HTML Images Quiz

Quiz
•
6th - 8th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
25 questions
Exploring POV and Unreliable Narrators

Quiz
•
7th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
20 questions
Typing Practice

Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade