WorksheetsVariables and Constants
Total questions: 10
Worksheet time: 5mins
What are the references for three basic data types?
string
int
flt
str
float
Which answer correctly initializes the number of tennis balls in a package?
numTennisBalls = 3
numTennisBalls = float(3)
numTennisBalls = "3"
numTennisBalls = int(3)
Which answer correctly initializes the number of cookies in a cookie jar?
numCookies = 14.5
numCookies = float(14.5)
numCookies = "14.5"
numCookies = int(14.5)
Which answer correctly initializes the name of the college as a constant?
collegeName = "Lone Star College"
COLLEGE_NAME= "Lone Star College"
collegeName = str ("Lone Star College")
COLLEGE_NAME= str(Lone Star College)
COLLEGE_NAME= str("Lone Star College")
What notation is used to store float variables ?
ASCII Notation
Float Notation
Floating Point Notation
Two's Complement Notation
Binary Notation
What notation is used to store int variables ?
ASCII Notation
Float Notation
Floating Point Notation
Two's Complement Notation
Binary Notation
What notation is used to store str variables ?
ASCII Notation
Float Notation
Floating Point Notation
Two's Complement Notation
Binary Notation
Once an integer variable is assigned a value ...
that value cannot be changed.
that value may be changed to any other value.
that value may only be changed to another integer
that value may only be changed to another numeric, either integer or float
Once an integer constant is assigned a value ...
that value cannot be changed.
that value may be changed to any other value.
that value may only be changed to another integer
that value may only be changed to another numeric, either integer or float
Which is a correct declaration and initialization for someone's phone number?
phoneNum = str("2819283321")
phoneNum = int(2819283321)
phoneNum = float(281.928.3321)
PHONE_NUM = int(2819283321)
