Learn practical skills, build real-world projects, and advance your career
Created 3 years ago
name= "Ivan Guan"
age = 19
has_android_phone = True
name, age, has_android_phone
('Ivan Guan', 19, True)
person = {"Name" : name , "Age" : age, "HasAndroidPhone" : has_android_phone }
for key in person:
print (person[key])
Ivan Guan
19
True
print("{} is aged {}, and owns an {}.".format(
person["Name"],
person["Age"],
"Android phone" if person["HasAndroidPhone"] else "iPhone"
))
Ivan Guan is aged 19, and owns an Android phone.
my_list = ["Blue", 0 , True]
my_list
['Blue', 0, True]
print("My favorite color is", my_list[0])
My favorite color is Blue