
Chapter 9 review
Quiz
•
Science
•
9th - 12th Grade
•
Practice Problem
•
Medium
Adrian Ortiga
Used 2+ times
FREE Resource
Enhance your content in a minute
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is my dog in the given code snippet?
my_dog = Dog('blacky', 2)
A method that initializes the dog object.
A variable representing the name of the dog.
An instance of the Dog class.
An attribute storing the dog's age.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access classes when importing an entire module?
Use the syntax module_name.class_name
Use the syntax class_name.module_name
You cannot import and entire module.
Use the syntax module_name -> class_name
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a method in Python?
A built-in Python keyword used to define classes.
A data type that stores a collection of values.
A function that's part of a class.
A statement used to control the flow of execution in a program.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if you only use one underscore before and after the method init()?
The method won't be called automatically when you use your class.
Nothing, everything will work OK.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when you create multiple instances of a class in Python with the same arguments?
Only the last instance created will retain the attribute values.
Each instance will have its own unique memory address and separate attribute values.
The program will throw an error indicating duplicate instances.
Each instance will have the same memory address but separate attribute values.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What attributes are included in the Dog class?
class Dog:
def init(self, name, age):
self.name = name
self.age = age
def sit(self):
print(f'{self.name} is now sitting.')
def roll_over(self):
print(f'{self.name} rolled over!')
name and age
only name
only age
the class dog has no attributes
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the attributes of an instance in Python?
By using the getattr() function (getattr(instance, 'attribute'))
By using square bracket notation (instance['attribute'])
By calling a method with the attribute name as an argument (instance.get_attribute('attribute'))
By using dot notation (instance.attribute)
Create a free account and access millions of resources
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
0 questions
Chapter 10: Object Oriented Programming
Quiz
•
0 questions
Creating and using classes in Python
Quiz
•
0 questions
Python classes and objects test
Quiz
•
0 questions
Python Classess OOP
Quiz
•
0 questions
Object-Oriented Programming (OOP) in Python 3 Quiz
Quiz
•
0 questions
Python OOP Terminology
Quiz
•
0 questions
Python Class Quiz
Quiz
•
0 questions
Python Classes Quiz
Quiz
•
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Science
20 questions
Name That Tune Christmas Edition
Quiz
•
6th - 9th Grade
10 questions
Exploring Plate Tectonics and Their Boundaries
Interactive video
•
6th - 10th Grade
20 questions
Human Impact on the Environment Review #2
Quiz
•
9th Grade
35 questions
Physical Science Semester 1 Final Review
Quiz
•
9th Grade
34 questions
ACA Final Unit 1 (Biochem/Cells)
Quiz
•
9th Grade
20 questions
The Cell Cycle and Mitosis
Quiz
•
9th Grade
20 questions
Newton's Laws of Motion
Quiz
•
7th - 9th Grade
20 questions
Balancing Chemical Equations
Quiz
•
9th Grade
