Python 3 Review Part 1

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
In the statement "my_number = 50", what is "my_number"?
A function
A variable name
A constant
A string
Answer explanation
In the statement "my_number = 50", "my_number" is a variable name that stores the value 50. It is not a function, constant, or string, making "A variable name" the correct choice.
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following is NOT a float?
5.5
0.0
7
3.14
Answer explanation
A float is a number that has a decimal point. Among the options, 5.5, 0.0, and 3.14 are floats because they contain decimal points. The number 7 is an integer, thus it is NOT a float.
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
If `a = True` and `b = False`, what is the result of the expression `a and not b`?
`True`
`False`
`None`
`Error`
Answer explanation
In the expression `a and not b`, `a` is True and `not b` evaluates to True (since `b` is False). Therefore, `True and True` results in True. The correct answer is `True`.
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the correct syntax to create a variable in Python?
variable my_number = 50
my_number = 50
let my_number = 50
const my_number = 50
Answer explanation
The correct syntax to create a variable in Python is 'my_number = 50'. This assigns the value 50 to the variable 'my_number'. The other options use syntax from different programming languages.
5.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
print("3"+"3")
33
6
INVALID OUTPUT
Answer explanation
The expression print("3"+"3") concatenates two strings "3" and "3", resulting in "33". Therefore, the correct answer is 33.
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
How is a float different from an integer?
It does not have a decimal component
It is always positive
It has a decimal component
It is always negative
Answer explanation
A float differs from an integer in that it has a decimal component, allowing for fractional values. Integers are whole numbers without any decimal part.
7.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
Which of the following is a function call in the example?
def print_a_number():
x = 10
print(x)
print_a_number()
Answer explanation
The function call in the example is 'print_a_number()'. This line executes the function defined earlier, while 'def print_a_number():' defines the function, and 'print(x)' outputs the value of x but is not a function call.
Create a free account and access millions of resources
Similar Resources on Wayground
17 questions
Python - Quiz

Quiz
•
9th - 11th Grade
16 questions
Python Basics

Quiz
•
KG - University
20 questions
Python Recap

Quiz
•
7th Grade - University
19 questions
Python Year 9 Quiz

Quiz
•
8th - 10th Grade
19 questions
Programming Techniques Survey

Quiz
•
8th - 12th Grade
22 questions
CodeHS AP CSP Unit 3 Review

Quiz
•
11th - 12th Grade
20 questions
Python

Quiz
•
9th - 12th Grade
20 questions
Python Basics ;)

Quiz
•
11th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade