langs = ["Python", "JavaScript", "Java", "Bash", "C", "C++"]
print("langs", langs, type(langs), "length", len(langs))
print("- langs[0]", langs[2], type(langs[2]))
langs ['Python', 'JavaScript', 'Java', 'Bash', 'C', 'C++'] <class 'list'> length 6
- langs[0] Java <class 'str'>
print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
name = "Shruthi Damodar"
print("name", name, type(name))

print()


# variable of type integer
print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
age = 17
print("age", age, type(age))

print()

# variable of type float
print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
score = 90.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", "C++"]
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"]))
What is the variable name/key? value? type? primitive or collection, why?
name Shruthi Damodar <class 'str'>

What is the variable name/key? value? type? primitive or collection, why?
age 17 <class 'int'>

What is the variable name/key? value? type? primitive or collection, why?
score 90.0 <class 'float'>

What is variable name/key? value? type? primitive or collection?
What is different about the list output?
langs ['Python', 'JavaScript', 'Java', 'Bash', 'C', 'C++'] <class 'list'> length 6
- langs[0] Python <class 'str'>

What is the variable name/key? value? type? primitive or collection, why?
What is different about the dictionary output?
person {'name': 'Shruthi Damodar', 'age': 17, 'score': 90.0, 'langs': ['Python', 'JavaScript', 'Java', 'Bash', 'C', 'C++']} <class 'dict'> length 4
- person["name"] Shruthi Damodar <class 'str'>
mylist = {1, 2, 3, 4}
print("mylist", mylist, type(mylist), "length", len(mylist))
mylist {1, 2, 3, 4} <class 'set'> length 4
InfoDb = []

InfoDb.append({
    "FirstName": "Shruthi",
    "LastName": "Damodar",
    "DOB": "October 29",
    "Residence": "San Diego",
    "Email": "damodar.shruthi@gmail.com",
    "TVShow": "Puppy Dog Pals",
    "Music": "Country Music"
})

print(InfoDb)
[{'FirstName': 'Shruthi', 'LastName': 'Damodar', 'DOB': 'October 29', 'Residence': 'San Diego', 'Email': 'damodar.shruthi@gmail.com', 'TVShow': 'Puppy Dog Pals', 'Music': 'Country Music'}]
def print_data(d_rec):
    print(d_rec["FirstName"], d_rec["LastName"])  
    print("\t", "Residence:", d_rec["Residence"]) 
    print("\t", "Birth Day:", d_rec["DOB"])  
    print("\t", "TVShow:", d_rec["TVShow"])
    print("\t", "Music:", d_rec["Music"])
    



def for_loop():
    print("For loop output\n")
    for record in InfoDb:
        print_data(record)

for_loop()
For loop output

Shruthi Damodar
	 Residence: San Diego
	 Birth Day: October 29
	 TVShow: Puppy Dog Pals
	 Music: Country Music
def while_loop():
    print("While loop output\n")
    i = 0
    while i < len(InfoDb):
        record = InfoDb[i]
        print_data(record)
        i += 1
    return

while_loop()
While loop output

Shruthi Damodar
	 Residence: San Diego
	 Birth Day: October 29
	 TVShow: Puppy Dog Pals
	 Music: Country Music

def recursive_loop(i):
    if i < len(InfoDb):
        record = InfoDb[i]
        print_data(record)
        recursive_loop(i + 1)
    return
    
print("Recursive loop output\n")
recursive_loop(0)
Recursive loop output

Shruthi Damodar
	 Residence: San Diego
	 Birth Day: October 29
	 TVShow: Puppy Dog Pals
	 Music: Country Music