Data Abstraction (3.1,3.2) Popcorn Hacks

tinga = "Tinga"
print(tinga)
Tinga
tinga = "tinga"
print(tinga)

numba = 7
print(numba)

rate = 7
print(rate>8)
print(rate>0)
tinga
7
False
True
numba1 = 1
numba2 = 2
numba3 = 3
numba1 = numba2
numba2 = numba3
print(numba1)
print(numba2)
print(numba3)
2
3
3
tinga_list = ["Tinga", "Binga", "Winga", "Linga", "Chinga"]
print(tinga_list[0])
print(tinga_list[1])
print(tinga_list[2])
print(tinga_list[3])
print(tinga_list[4])
print(tinga_list)
Tinga
Binga
Winga
Linga
Chinga
['Tinga', 'Binga', 'Winga', 'Linga', 'Chinga']
import json
names = ["Tinga", "Binga", "Winga", "Linga", "Chinga"]
json.obj = json.dumps(names)
print(json.obj)
["Tinga", "Binga", "Winga", "Linga", "Chinga"]
secretNumber = 15 # integer
print(secretNumber)

food = "Pizza" # string
print(food)

names = ["Nandan", "Arnav", "Torin", "Remy"] # list
print(names)

IamCool = True # boolean

print(IamCool)

##Bonus Problem:

names_2 = {
    "Nandan": "TeamMate1",
    "Arnav": "TeamMate2",
    "Torin": "TeamMate3",
    "Remy": "TeamMate4",
}

print(names_2)


15
Pizza
['Nandan', 'Arnav', 'Torin', 'Remy']
True
{'Nandan': 'TeamMate1', 'Arnav': 'TeamMate2', 'Torin': 'TeamMate3', 'Remy': 'TeamMate4'}
questions = ["What period do I have AP CSP?", "What was this lesson on?", "What type of variable is used for numbers?"]
answers = ["5", "Data Abstraction", "Integer"]

score = 0
question_index = 0

while question_index < len(questions):
    print("Question", question_index + 1, ":", questions[question_index])
    user_answer = input("Enter your answer: ")
  
    if user_answer.lower() == answers[question_index].lower():
        print("Correct!")
        score += 1
 
    else:
        print("Incorrect.")
    question_index += 1
    
print("Quiz complete! You scored", score, "out of", len(questions))