Four
All variables must have a _____ and a ______.
name and value
Write the proper syntax for the print command
print()
message = "says hello"
myName = "Ms. Jones"
print(myName, message)
Ms. Jones says hello
"Y'all got a quiz tomorrow"
String (str)
What is the full name of the data type shortened to "float"?
Floating Point Numbers
How would I create a variable named yourQuizGrade and assign it to the value of A+++
yourQuizGrade = "A+++"
(True or False) When printing a string, you must include quotation marks.
True
(ex: print("the answer is True") is correct)
print("hello world" + 2)
Error
Integer (int)
What is the abbreviation of the integer data type?
What is wrong with this variable name?
2004Camry
Starts with a number
Write a line of code that will print the number 12 as a string type (instead of an integer)
print("12")
print("2+3*4")
2+3*4
1234321.0
Floating Point Number (float)
What is the data type that represents binary responses (ex: True/False)?
Boolean (bool)
What is it called when you change the value of a variable?
Reassignment
(True or False) When printing a variable, you must include quotation marks.
False
(ex: if you have a variable name myVariable, print(myVariable) is correct syntax)
favColor = "Orange"
print(fav_color)
ERROR
"True"
String (str)
What must a value have to be considered a String?
Quotation marks
Give one way to improve this variable name according to our naming conventions:
msjonessroomnumber = 124
ms_joness_room_number
or
msJonessRoomNumber
The variables for prices of folders and binders are as follows:
folder = .75
binder = 1.25
Write a print statement that will tell me how much 2 folders and 3 binders will cost.
print(2*folder + 3*binder)
jar1 = 5
jar2 = 3
total = jar1 + jar2
print("total")
total
False
Boolean (bool)