1.7 Practice
Working with Variables
Answer the following questions using Python.
Create 5 variables with the following names and types then print each in the console:
nameas a stringageas an integergrade: floatis_student: booleanfavorite_color: string
Reassign each variable to the same value, but this time use type hinting to declare the data type of each variable.
Reassign the
namevariable the same name but in all uppercase letters using a string method. Print the new value ofnamein the console.Add the
agevariable to thegradevariable. What is the data type of the result? Print the type of the output to the console using the built-in type function.Create a dictionary named
personthat includes each variable you created in step 2 as a key and its value as the value. Print the dictionary in the console.Use an f-string to print a sentence that includes the
name,age, andfavorite_colorkeys from thepersondictionary. It should follow this pattern: “My name is [name]. I am [age] years old. My favorite color is [favorite_color]. I will get a [grade] in this class.”