Variables for Strings Flashcards
Because of the quotation marks, Python identifies the greeting below as a _______ (1 word, lowercase)
string
Because there are no quotation marks, Python identifies the set of characters below as a _______.
variable
Assign the string “Boo!” to the variable scare.
scare = “Boo!”
Assign the string “jay” to the variable bird.
bird = “jay”
Assign your first name to a variable. You choose the variable name.
my_name = “Mark”
Assign a string to a variable. You choose the variable name and the string.
gender = “male”
In the statement below, I assign a string to a variable. Using the variable, write the statement that displays the string on the screen.
my_name = “Mark”
print(my_name)
Assign a string to a variable. You choose the variable name and the string. Using the variable, write a statement that displays the string on the screen.
city = “London”
print(city)
Revise this variable name as the Python governing body recommends.
countryoforigin
country_of_origin
Assign the string “Hi” to the variable greeting
greeting = “Hi”