Assign your name to the variable name.
Assign your age (real or fake) to the variable age.
Assign a boolean value to the variable has_android_phone.
Create a dictionary person with keys "Name", "Age", "HasAndroidPhone" and values using the variables defined above.
Use a for loop to display the type of each value stored against each key in person.
name = 'John Snow'
age = 25
has_android_phone = True
person = {"Name":name, "Age":age, "HasAndroidPhone":has_android_phone}
for key in person:
print(type(person[key]), '-', key)
Comments
Leave a comment