My list and dictionary

I switched it up and made some lists and dictionaries

These are just the Questions

questions = [
    "What is your first name?",
    "How Old are you?",
    "What is your favorite food?",
    "What is your favorite color?",
    "What is your favorite place?",
    "who are your friends",
]
print(questions)
['What is your first name?', 'how Old are you?', 'What is your favorite food?', 'What is your favorite color?', 'What is your favorite place?', 'who are your friends']

Questions with Answers

These questiona are the ones with answers

print("What is your first name?")
name = "Big Man Nathan"
print(name)


print("How old are you?")
age = "16"
print(age)


# variable of type integer
print("What is your favorite Food")
food = "Pizza"
print(food)


print("How old are you?")
color = "Hot pink"
print(color)


# variable of type float
print("What is your favoirte place")
place = "Europe"
print(place)


# variable of type list (many values in one variable)
print("Who are your friends")
friends = "The leader of the friend group, Gene, Caleb"
print(friends)


# variable of type dictionary (a group of keys and values)
print("Is this you?")
person = {
    "Your Name": name,

    "Your Age": age,

    "Favorite Food": food,

    "Favorite Place": place,

    "Your Friends": friends
}
print(person)
What is your first name?
Big Man Nathan
How old are you?
16
What is your favorite Food
Pizza
How old are you?
Hot pink
What is your favoirte place
Europe
Who are your friends
The leader of the friend group, Gene, Caleb
Is this you?
{'Your Name': 'Big Man Nathan', 'Your Age': '16', 'Favorite Food': 'Pizza', 'Favorite Place': 'Europe', 'Your Friends': 'The leader of the friend group, Gene, Caleb'}
InfoDb = []

# InfoDB is a data structure with expected Keys and Values

# Append to List a Dictionary of key/values related to a person and cars
InfoDb.append({
    "FirstName": "Caleb",
    "LastName": "Navarro",
    "age": "16",
    "DOB": "April 14",
    "Residence": "San Diego",
    "Email": "caleb.evan.navarro@gmail.com",
    "Owns_Cars": ["Bugatti La Voiture Noire", "Audi A4"]
})

# Append to List a 2nd Dictionary of key/values
InfoDb.append({
    "FirstName": "Billy",
    "LastName": "Bob",
    "age": "21",
    "DOB": "December 21",
    "Residence": "Europe",
    "Email": "bigboybilly@gmail.com",
    "Owns_Cars": ["Tesla"]
})

InfoDb.append({
    "FirstName": "Nathan",
    "LastName": "Capule",
    "age": "16",
    "DOB": "July 8",
    "Residence": "Star Killer Base",
    "Email": "plrttapotty@gmail.com",
    "Owns_Cars": ["2019 Lamborghini Huracan Performante, Gerald R. Ford-class aircraft carrier, Starship"]
})

# Print the data structure
print(InfoDb)

def print_data(d_rec):
    print(d_rec["FirstName"], d_rec["LastName"])  # using comma puts space between values
    print("\t", "age:", d_rec["age"])
    print("\t", "Residence:", d_rec["Residence"]) # \t is a tab indent
    print("\t", "Birth Day:", d_rec["DOB"])
    print("\t", "Cars: ", end="")  # end="" make sure no return occurs
    print(", ".join(d_rec["Owns_Cars"]))  # join allows printing a string list with separator
    print()


# for loop algorithm iterates on length of InfoDb
def for_loop():
    print("For loop output\n")
    for record in InfoDb:
        print_data(record)

for_loop()
[{'FirstName': 'Caleb', 'LastName': 'Navarro', 'age': '16', 'DOB': 'April 14', 'Residence': 'San Diego', 'Email': 'caleb.evan.navarro@gmail.com', 'Owns_Cars': ['Bugatti La Voiture Noire', 'Audi A4']}, {'FirstName': 'Billy', 'LastName': 'Bob', 'age': '21', 'DOB': 'December 21', 'Residence': 'Europe', 'Email': 'bigboybilly@gmail.com', 'Owns_Cars': ['Tesla']}, {'FirstName': 'Nathan', 'LastName': 'Capule', 'age': '16', 'DOB': 'July 8', 'Residence': 'Star Killer Base', 'Email': 'plrttapotty@gmail.com', 'Owns_Cars': ['2019 Lamborghini Huracan Performante, Gerald R. Ford-class aircraft carrier, Starship']}]
For loop output

Caleb Navarro
	 age: 16
	 Residence: San Diego
	 Birth Day: April 14
	 Cars: Bugatti La Voiture Noire, Audi A4

Billy Bob
	 age: 21
	 Residence: Europe
	 Birth Day: December 21
	 Cars: Tesla

Nathan Capule
	 age: 16
	 Residence: Star Killer Base
	 Birth Day: July 8
	 Cars: 2019 Lamborghini Huracan Performante, Gerald R. Ford-class aircraft carrier, Starship

import getpass, sys

questions = 3
correct = 0

def question_with_response(prompt):
    print("Question: " + prompt)
    msg = input()
    return msg

def question_and_answer(prompt):
    print("Question: " + prompt)
    msg = input()
    print("Answer: " + msg)

question_and_answer("How has your day been today?")
question_and_answer("Do you have friends?")
question_and_answer("Do you like ice cream")

print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You will be asked " + str(questions) + " questions.")
question_and_answer("Are you ready for some questions?")


rsp = question_with_response("what is 10+6?")
if rsp == "16":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What many tacos should you eat a day?")
if rsp == "42,069":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("From 1 to 10 how hot is toby?")
if rsp == "69":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Question: How has your day been today?
Answer: 
Question: Do you have friends?
Answer: 
Question: Do you like ice cream
Answer: 
Hello, Caleb running c:\Users\Caleb\AppData\Local\Programs\Python\Python310\python.exe
You will be asked 3 questions.
Question: Are you ready for some questions?
Answer: 
Question: what is 10+6?
 is incorrect!
Question: What many tacos should you eat a day?
 is incorrect!
Question: From 1 to 10 how hot is toby?
 is incorrect!
Caleb you scored 0/3