wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Variables

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What type of data is the following?: X = "195.67"

a)

Float

b)

String

c)

Boolean

d)

integer

2.

What type of variable is the following?: Y = False

a)

Float

b)

String

c)

Integer

d)

Boolean

3.

What does the following Python program print?

X = "Hello World!"

Y = "I can code "

Z = " In Python"

print( X + Y + Z)

a)

Hello World! I can code In Python

b)

Hello World!I can code In Python

c)

Hello World! I can codeIn Python

d)

Hello World!I can code In Python

4.

Variables have three things:

a)

Numeric, string, Boolean

b)

Integer, float, string

c)

name, type, value

d)

function, value, name

5.

When you want to print something to the screen you should use

a)

The keyboard to type it

b)

The computer Display

c)

A monitor

d)

a print statement

6.

print("Python " * 3); will print out what

a)

Python 3 Python 3 Python 3

b)

Python Python Python

c)

PythonPythonPython

d)

Python*3 Python*3 Python*3

7.

Which one to the following Python programs will not run?

a)

num = 4

greeting = "Hello"

print(num + greeting)

b)

grade = 98.7

letterGrade = "A+"

print(str(grade) + letterGrade

c)

studentNum =80

print("studentNum")

d)

print("Hello World!")

8.

Which of the following is NOT a program that will produce the following output?

SeasonSeasonSeason

a)

word = "Season" * 3

print(word)

b)

word = "Season" + "Season" + "Season"

print(word)

c)

num = 3

word = "Season" * 3

print(word)

d)

word = "Season"

print(word)

print(word)

print(word)

9.

float, integer, boolean, and string are all examples of what?

a)

Variables

b)

Data Types

c)

Words

d)

Concatenation

10.

The following statement/code snippet is an example of what?

color = blue

a)

All is correct

b)

Variable/variable assignment

c)

Variable declaration

d)

Variable initialization