name = "Drew Reed"
print("name", name, type(name))
print("The variable key is 'name'. The value is 'Drew Reed'. It is a string.")

print()

age = 16
print("age", age, type(age))
print("The variable key is 'age'. Its value is '16'. It is an integer.")

print()

score = 90.0
print("score", score, type(score))
print("The variable key is 'score'. Its value is '90.0'. It is a float, a.k.a. a floating point number.")

print()

print("What is variable name/key?", "value?", "type?", "primitive or collection?")
print("What is different about the list output?")
langs = ["Python", "JavaScript", "Java", "Bash"]
print("langs", langs, type(langs), "length", len(langs))
print("- langs[3]", langs[3], type(langs[3]))
print("The variable")

print()

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"]))
print("It comes out with little squiggly brackets.")
name Drew Reed <class 'str'>
The variable key is 'name'. The value is 'Drew Reed'. It is a string.

What is the variable name/key? value? type? primitive or collection, why?
age 16 <class 'int'>
The variable key is 'age'. Its value is '16'. It is an integer.

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'] <class 'list'> length 4
- langs[3] Bash <class 'str'>

What is the variable name/key? value? type? primitive or collection, why?
What is different about the dictionary output?
person {'name': 'Drew Reed', 'age': 16, 'score': 90.0, 'langs': ['Python', 'JavaScript', 'Java', 'Bash']} <class 'dict'> length 4
- person["name"] Drew Reed <class 'str'>
InfoDb = []

InfoDb.append({
    "FirstName": "John",
    "LastName": "Mortensen",
    "DOB": "October 21",
    "Residence": "San Diego",
    "Email": "jmortensen@powayusd.com",
    "Owns_Cars": ["2015-Fusion", "2011-Ranger", "2003-Excursion", "1997-F350", "1969-Cadillac"]
})

InfoDb.append({
    "FirstName": "Sunny",
    "LastName": "Naidu",
    "DOB": "August 2",
    "Residence": "Temecula",
    "Email": "snaidu@powayusd.com",
    "Owns_Cars": ["4Runner"]
})

InfoDb.append({
    "FirstName": "Drew",
    "LastName": "Reed",
    "DOB": "November 7",
    "Residence": "San Diego",
    "Email": "drewdafox@gmail.com",
    "Owns_Cars": ["Toyota Camry"]
})

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", "Cars: ", end="")
    print(", ".join(d_rec["Owns_Cars"]))
    print()


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

for_loop()
For loop output

John Mortensen
	 Residence: San Diego
	 Birth Day: October 21
	 Cars: 2015-Fusion, 2011-Ranger, 2003-Excursion, 1997-F350, 1969-Cadillac

Sunny Naidu
	 Residence: Temecula
	 Birth Day: August 2
	 Cars: 4Runner

Drew Reed
	 Residence: Temecula
	 Birth Day: November 7
	 Cars: Toyota Camry

This can be a little bit confusing, so let's put this in simpler terms.

When defining print_data, the different data in the Info.Db is called upon based on its Dictionary definition and placed in a visually appealing way using \t and spacing with comma.

Let's look at how to loop the output of the info just enough to get it out.

InfoDb = []

InfoDb.append({
    "FirstName": "John",
    "LastName": "Mortensen",
    "DOB": "October 21",
    "Residence": "San Diego",
    "Email": "jmortensen@powayusd.com",
    "Owns_Cars": ["2015-Fusion", "2011-Ranger", "2003-Excursion", "1997-F350", "1969-Cadillac"]
})

InfoDb.append({
    "FirstName": "Sunny",
    "LastName": "Naidu",
    "DOB": "August 2",
    "Residence": "Temecula",
    "Email": "snaidu@powayusd.com",
    "Owns_Cars": ["4Runner"]
})

InfoDb.append({
    "FirstName": "Drew",
    "LastName": "Reed",
    "DOB": "November 7",
    "Residence": "Temecula",
    "Email": "drewdafox@gmail.com",
    "Owns_Cars": ["Toyota Camry"]
})

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", "Cars: ", end="")  # end="" make sure no return occurs
    print(", ".join(d_rec["Owns_Cars"]))
    print()

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()

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)
While loop output

John Mortensen
	 Residence: San Diego
	 Birth Day: October 21
	 Cars: 2015-Fusion, 2011-Ranger, 2003-Excursion, 1997-F350, 1969-Cadillac

Sunny Naidu
	 Residence: Temecula
	 Birth Day: August 2
	 Cars: 4Runner

Drew Reed
	 Residence: Temecula
	 Birth Day: November 7
	 Cars: Toyota Camry

Recursive loop output

John Mortensen
	 Residence: San Diego
	 Birth Day: October 21
	 Cars: 2015-Fusion, 2011-Ranger, 2003-Excursion, 1997-F350, 1969-Cadillac

Sunny Naidu
	 Residence: Temecula
	 Birth Day: August 2
	 Cars: 4Runner

Drew Reed
	 Residence: Temecula
	 Birth Day: November 7
	 Cars: Toyota Camry

While loops and recursive loops work very similarly, just making use of slightly different commands. Both compare how much content is contained within InfoDb with how much has already been output (indicated by the i value).