ok so i need help with some python programming. I have a random quiz made and i don't know how to get a scoreboard which updates when someone finishes the quiz. Is this possible? Plz help
Players = []
Score = []
Name=str(input("What is your name?: "))
Players.append(Name)
Age=int(input("What is your age?: "))
import random
correct = 0
for count in range(10):
num1 = random.randint(1, 10)
num2 = random.randint(1, 10)
symbol = random.choice(["+", "-", "*"])
print("Please solve:\n", num1, symbol, num2)
user = int(input(""))
if symbol == "+":
answer = num1 + num2
elif symbol == "-":
answer = num1 - num2
elif symbol == "*":
answer = num1 * num2
if user == answer:
print("Correct")
correct = correct + 1
else:
print("Wrong")
print(Name, ", You Got", correct, "Out Of 10")
Score.append(correct)
list
Aucun commentaire:
Enregistrer un commentaire