Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Variables and Constants

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What are the references for three basic data types?

a)

string

b)

int

c)

flt

d)

str

e)

float

2.

Which answer correctly initializes the number of tennis balls in a package?

a)

numTennisBalls = 3

b)

numTennisBalls = float(3)

c)

numTennisBalls = "3"

d)

numTennisBalls = int(3)

3.

Which answer correctly initializes the number of cookies in a cookie jar?

a)

numCookies = 14.5

b)

numCookies = float(14.5)

c)

numCookies = "14.5"

d)

numCookies = int(14.5)

4.

Which answer correctly initializes the name of the college as a constant?

a)

collegeName = "Lone Star College"

b)

COLLEGE_NAME= "Lone Star College"

c)

collegeName = str ("Lone Star College")

d)

COLLEGE_NAME= str(Lone Star College)

e)

COLLEGE_NAME= str("Lone Star College")

5.

What notation is used to store float variables ?

a)

ASCII Notation

b)

Float Notation

c)

Floating Point Notation

d)

Two's Complement Notation

e)

Binary Notation

6.

What notation is used to store int variables ?

a)

ASCII Notation

b)

Float Notation

c)

Floating Point Notation

d)

Two's Complement Notation

e)

Binary Notation

7.

What notation is used to store str variables ?

a)

ASCII Notation

b)

Float Notation

c)

Floating Point Notation

d)

Two's Complement Notation

e)

Binary Notation

8.

Once an integer variable is assigned a value ...

a)

that value cannot be changed.

b)

that value may be changed to any other value.

c)

that value may only be changed to another integer

d)

that value may only be changed to another numeric, either integer or float

9.

Once an integer constant is assigned a value ...

a)

that value cannot be changed.

b)

that value may be changed to any other value.

c)

that value may only be changed to another integer

d)

that value may only be changed to another numeric, either integer or float

10.

Which is a correct declaration and initialization for someone's phone number?

a)

phoneNum = str("2819283321")

b)

phoneNum = int(2819283321)

c)

phoneNum = float(281.928.3321)

d)

PHONE_NUM = int(2819283321)