print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
name = "Ethan Tran"
print("name", name, type(name))
print()
# variable of type integer
print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
age = 15
print("age", age, type(age))
print()
# variable of type float
print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
score = 100.0
print("score", score, type(score))
print()
# variable of type list (many values in one variable)
print("What is variable name/key?", "value?", "type?", "primitive or collection?")
print("What is different about the list output?")
langs = ["Python", "JavaScript", "Java" , "Bash" , "C" , "R"]
print("langs", langs, type(langs), "length", len(langs))
print("- langs[0]", langs[0], type(langs[0]))
print()
# variable of type dictionary (a group of keys and values)
print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
print("What is different about the dictionary output?")
person = {
"name": name,
"age": age,
"score": score,
"langs": langs,
}
print("person", person, type(person), "length", len(person))
print('- person["name"]', person["name"], type(person["name"]))