
Python Class Quiz
Authored by Herr Blank
Computers
11th Grade
DOK Level 2: Skill/Concept covered
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to create an instance of a class named `Vehicle`?
`Vehicle newCar = new Vehicle();`
`newCar = Vehicle()`
`newCar = Vehicle`
`newCar = Vehicle()`
Tags
DOK Level 2: Skill/Concept
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is true about attributes in Python classes?
Attributes are always public and can be accessed using any instance.
Attributes can be defined within methods and accessed outside the class.
Attributes are variables that belong to the class.
Attributes cannot be initialized in the constructor.
Tags
DOK Level 2: Skill/Concept
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the `__init__` method do in a Python class?
It is called to initialize the class's state.
It declares the class to other modules.
It is called automatically whenever a new object is created.
Both A and C are correct.
Tags
DOK Level 2: Skill/Concept
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Python, how do you define a constructor for initializing the attributes of a class?
`def __init__(self):`
`def __constructor__(self):`
`def Vehicle(self):`
`def __init__():`
Tags
DOK Level 2: Skill/Concept
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of inheritance in Python classes?
To allow classes to inherit methods and attributes from other modules.
To permit the creation of new classes that reuse, extend, and modify the behavior defined in other classes.
To prevent duplication of code across similar classes.
All of the above are correct.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you call a method from a parent class in a child class method in Python?
`super().methodName()`
`parent.methodName()`
`self.methodName()`
`methodName()`
Tags
DOK Level 2: Skill/Concept
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to add an attribute `color` to a class `Car` and initialize it?
```python class Car: def __init__(self, color): self.color = color ```
```python class Car: color = '' def __init__(self, color): color = self.color ```
```python class Car: def __init__(self, color): color = color ```
```python class Car: def __init__(self): self.color = 'color' ```
Tags
DOK Level 2: Skill/Concept
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
11 questions
Computer Programming: Graphics
Quiz
•
8th - 11th Grade
10 questions
Mr. Baker's Class Rules
Quiz
•
7th - 12th Grade
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
10 questions
Analisis Data
Quiz
•
11th Grade
15 questions
Conditionals Unit Quiz
Quiz
•
9th Grade - University
10 questions
k10 - bài 17
Quiz
•
11th Grade
10 questions
Conhecimentos prévios em Java
Quiz
•
10th - 12th Grade
16 questions
2.6 The Internet Address Pt 2
Quiz
•
11th - 12th 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