
Python Variables Quiz
Authored by DirectEd Development
Other
Professional Development
Used 158+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a variable?
A tool to run Python programs
A container that holds information
A mathematical equation
A Python function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a rule for naming variables in Python?
A variable name must start with a letter or underscore
Variable names are case-sensitive
A variable name can start with a number
A variable name can contain alpha-numeric characters and underscores
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the single equal sign (=) in Python do?
It compares two values
It assigns a value to a variable
It divides one value by another
It creates a new variable
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many variables are created in the following code? cars = 100 space_in_a_car = 4.0 drivers = 30 passengers = 90 cars_not_driven = cars - drivers cars_driven = drivers carpool_capacity = cars_driven * space_in_a_car average_passengers_per_car = passengers / cars_driven
4
6
8
10
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following variable names is INVALID in Python?
my_variable
_age
1name
Name
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the following line in the code? cars_not_driven = cars - drivers
It creates a variable called cars_not_driven and assigns it the sum of cars and drivers
It creates a variable called cars_not_driven and assigns it the difference between cars and drivers
It prints the value of cars_not_driven
It declares the value of cars and drivers
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this line of code if drivers = 30 and space_in_a_car = 4.0? carpool_capacity = drivers * space_in_a_car print(carpool_capacity)
34.0
120
12
90
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
10 questions
Apple
Quiz
•
Professional Development
10 questions
Tatalaksana Penyakit Jantung: Komplikasi Hipertensi Tidak Terkon
Quiz
•
Professional Development
10 questions
Love Your Art Quiz
Quiz
•
Professional Development
11 questions
Mythical Creatures
Quiz
•
KG - Professional Dev...
12 questions
Ice-Breaking Session 2
Quiz
•
Professional Development
15 questions
Cars Mania
Quiz
•
KG - Professional Dev...
10 questions
Car Facts
Quiz
•
2nd Grade - Professio...
15 questions
Robotics and Artificial Intelligence
Quiz
•
6th Grade - Professio...
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
Discover more resources for Other
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...