
G10 Unit 2 Exercises
Authored by Razan Alghamdi undefined
Computers
10th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is an object in Python?
A variable
An instance of a class
A blueprint for creating classes
A keyword
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create an object of a class in Python?
By using the class name followed by parentheses
By importing the class from a module
By using the new keyword followed by the class name
By declaring a variable as an instance of the class type
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the __init__ method in a class in Python?
To initialize instance variables of a class object
To define class methods
To create objects
To import modules
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the output that will be printed by the following Python program: class Rose:
def __init__(self, name, color):
self.name = name
self.color = color
rose = Rose("Red Rose", "Red")
print(rose.name)
Red Rose
Rose
Red
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the output that will be printed by the following Python program: class Rose:
def __init__(self, name, color):
self.name = name
self.color = color
def smell(self):
print(self.name)
rose = Rose("Red Rose", "Red")
rose.smell()
Red Rose
Fragrant!
Red
Rose
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the output that will be printed by the following Python program: class Flower:
def __init__(self, name, color, fragrance):
self.name = name
self.color = color
self.fragrance = fragrance
flower = Flower("Rose", "Red", True)
if flower.fragrance:
print("This flower has a fragrance.")
else:
print("This flower does not have a fragrance.")
This flower has a fragrance.
Red
This flower does not have a fragrance.
Rose
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a higher-order function?
A function that takes one or more functions as arguments
A function that only operates on numbers
A function that returns another function as a result
A function that can only be used once
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
# REVIEW 1 DATA TYPES
Quiz
•
10th Grade
20 questions
Network topologies
Quiz
•
8th Grade - University
15 questions
Quiz 1
Quiz
•
1st - 12th Grade
15 questions
Data Security Worksheet
Quiz
•
10th Grade - University
13 questions
Arrays in Swift
Quiz
•
10th - 12th Grade
20 questions
2324tx6
Quiz
•
9th - 12th Grade
13 questions
Copyrights and Wrongs Assessment
Quiz
•
9th - 12th Grade
13 questions
Guess the Retro Computer 1
Quiz
•
KG - Professional Dev...
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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