print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
name = "Sarah Liu"
print("name", name, type(name))
print()

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

print()

print("What is the variable name/key?", "value?", "type?", "primitive or collection, why?")
score = 90.0
print("score", score, type(score))

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[0]", langs[0], type(langs[0]))

print()

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 Sarah Liu <class 'str'>

What is the variable name/key? value? type? primitive or collection, why?
age 16 <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'] <class 'list'> length 4
- 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': 'Sarah Liu', 'age': 16, 'score': 90.0, 'langs': ['Python', 'JavaScript', 'Java', 'Bash']} <class 'dict'> length 4
- person["name"] Sarah Liu <class 'str'>
InfoDb = []

InfoDb.append({
    "FirstName": "Sarah",
    "LastName": "Liu",
    "DOB": "January 12",
    "Residence": "San Diego",
    "Favorite Artist": "Kanye West",
    "Favorite Color": "Red", 
})

InfoDb.append({
    "FirstName": "Amay",
    "LastName": "Advani",
    "DOB": "June 10",
    "Residence": "San Diego",
    "Favorite Artist": "Kanye West",
    "Favorite Color": "Blue",
})

print(InfoDb)
[{'FirstName': 'Sarah', 'LastName': 'Liu', 'DOB': 'January 12', 'Residence': 'San Diego', 'Favorite Artist': 'Kanye West', 'Favorite Color': 'Red'}, {'FirstName': 'Amay', 'LastName': 'Advani', 'DOB': 'June 10', 'Residence': 'San Diego', 'Favorite Artist': 'Kanye West', 'Favorite Color': 'Blue'}]
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", "Favorite Artist:", d_rec["Favorite Artist"])  
    print("\t", "Favortie Color:", d_rec["Favorite Color"])
    print()


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

for_loop()
For loop output

Sarah Liu
	 Residence: San Diego
	 Birth Day: January 12
	 Favorite Artist: Kanye West
	 Favortie Color: Red

Amay Advani
	 Residence: San Diego
	 Birth Day: June 10
	 Favorite Artist: Kanye West
	 Favortie Color: Blue

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

Sarah Liu
	 Residence: San Diego
	 Birth Day: January 12
	 Favorite Artist: Kanye West
	 Favortie Color: Red

Amay Advani
	 Residence: San Diego
	 Birth Day: June 10
	 Favorite Artist: Kanye West
	 Favortie Color: Blue

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

Sarah Liu
	 Residence: San Diego
	 Birth Day: January 12
	 Favorite Artist: Kanye West
	 Favortie Color: Red

Amay Advani
	 Residence: San Diego
	 Birth Day: June 10
	 Favorite Artist: Kanye West
	 Favortie Color: Blue

import getpass, sys

def question_and_answer(prompt,answer):
    print("Question: " + prompt)
    msg = input()
    if answer == msg.lower():
        print("Correct Answer")
        global correct
        correct += 1
    else:
        print("Incorrect answer")

questions = 6
correct = 0

Question1 = question_and_answer("Area 51 is located in which US state? 1 for Nevada, 2 for California, 3 for Texas, 4 for Florida" , "1")
Question2 = question_and_answer("What is the nickname of the US state of California? 1 for Tree State, 2 for Desert State, 3 for Golden State, 4 for Orange State", "3")
Question3 = question_and_answer("Who is depicted on the US hundred-dollar bill? 1 for George Washington, 2 for Benjamin Franklin, 3 for Andrew Jackson, 4 for Abraham Lincoln", "2")
Question4 = question_and_answer("Who is the author of Jurrasic Park? 1 for Michael Crichton, 2 for JK Rowling, 3 for Stephen King, 4 for William Shakespeare", "1")
Question5 = question_and_answer("What is the last letter of the Greek alphabet? 1 for Alpha, 2 for Beta, 3 for Delta, 4 for Omega", "4")
Question6 = question_and_answer("Who is the mascot for the fast-food chain, KFC? 1 for Colonel Sanders, 2 for McDonalds Clown, 3 for Jack Box, 4 for Wendy", "1")

print(correct, "answers correct", correct*100/questions,"%")

Quiz = {
    "Question One": Question1, 
    "Question Two": Question2,
    "Question Three": Question3,
    "Question Four": Question4,
    "Question Five": Question5,
    "Question Six": Question6,
}

print("Your answers:",Quiz)
Question: Area 51 is located in which US state? 1 for Nevada, 2 for California, 3 for Texas, 4 for Florida
Correct Answer
Question: What is the nickname of the US state of California? 1 for Tree State, 2 for Desert State, 3 for Golden State, 4 for Orange State
Correct Answer
Question: Who is depicted on the US hundred-dollar bill? 1 for George Washington, 2 for Benjamin Franklin, 3 for Andrew Jackson, 4 for Abraham Lincoln
Correct Answer
Question: Who is the author of Jurrasic Park? 1 for Michael Crichton, 2 for JK Rowling, 3 for Stephen King, 4 for William Shakespeare
Correct Answer
Question: What is the last letter of the Greek alphabet? 1 for Alpha, 2 for Beta, 3 for Delta, 4 for Omega
Correct Answer
Question: Who is the mascot for the fast-food chain, KFC? 1 for Colonel Sanders, 2 for McDonalds Clown, 3 for Jack Box, 4 for Wendy
Correct Answer
6 answers correct 100.0 %
Your answers: {'Question One': None, 'Question Two': None, 'Question Three': None, 'Question Four': None, 'Question Five': None, 'Question Six': None}
alphabet = ["a","b", "c", "d"]
alphabetC = 0
for x in reversed(alphabet):
    if alphabetC-2<len(alphabet):
        print("- alphabet[",alphabetC,"]", x, type(alphabet[alphabetC]))
        alphabetC += 1
- alphabet[ 0 ] d <class 'str'>
- alphabet[ 1 ] c <class 'str'>
- alphabet[ 2 ] b <class 'str'>
- alphabet[ 3 ] a <class 'str'>