Worksheet Variables in Python
Worksheet Variables in Python
Examples
Questions
1. Question 1:
Create a variable called my_name and store your name in it. Print the variable.
# Write your code here
2. Question 2:
Create a variable called my_favorite_food and store your favorite food in it. Print the
variable.
# Write your code here
3. Question 3:
Create two variables called x and y. Store the numbers 4 and 6 in them. Add them
together and store the answer in a variable called sum. Print sum.
# Write your code here
4. Question 4:
Create two variables called apples and bananas. Store the numbers 5 and 8 in them.
Subtract the number of apples from the number of bananas and store the result in a
variable called fruit_difference. Print fruit_difference.
# Write your code here
5. Question 5:
Look at this variable name: my_home_city.
Is this a correct name for a variable? Why or why not?