Python Variables Quiz

Python Variables Quiz

Professional Development

10 Qs

quiz-placeholder

Similar activities

Very hard car quiz

Very hard car quiz

5th Grade - Professional Development

10 Qs

Sports cars

Sports cars

KG - Professional Development

13 Qs

Career Quiz

Career Quiz

Professional Development

14 Qs

UPSHIFT roll out

UPSHIFT roll out

Professional Development

10 Qs

cars.co

cars.co

2nd Grade - Professional Development

13 Qs

marcus lego

marcus lego

Professional Development

10 Qs

Pengenalan Programming AI

Pengenalan Programming AI

Professional Development

10 Qs

Titanic speed analysis

Titanic speed analysis

Professional Development

7 Qs

Python Variables Quiz

Python Variables Quiz

Assessment

Quiz

Other

Professional Development

Easy

Created by

DirectEd Development

Used 157+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?