27 lines
600 B
Python
27 lines
600 B
Python
animals = {
|
|
"cat": "meow",
|
|
"dog": "woof",
|
|
"bird": "chirp",
|
|
"fish": "swim",
|
|
"snake": "slither",
|
|
"horse": "neigh",
|
|
}
|
|
|
|
score = [0, 0] # correct, total
|
|
|
|
run = True
|
|
|
|
while run:
|
|
for i in animals:
|
|
print(f"What animal goes {animals[i]}?")
|
|
answer = input("> ")
|
|
|
|
if answer.lower().strip() == i.lower():
|
|
print(f"Correct! {i} goes {animals[i]}.")
|
|
score[0] += 1
|
|
score[1] += 1
|
|
print(f"Score: {round(score[0]/score[1]*100)}%")
|
|
|
|
if not round(score[0]/score[1]*100) < 60:
|
|
run = True
|
|
score = [0, 0] |