Create Task Program Code
Create Task Program Code
points = 0
import time
import os
#This function has the parameter "points" asks the user questions and gives them points for the
correct answer
def startQuiz(points):
os.system('clear')
for x in range(len(questions)):
print(questions[x])
answer = input("Pick a letter: ")
time.sleep(1)
if answer.lower() == answers[x]:
print()
print("Congrats! You earned one point.")
points = points + 1
print()
time.sleep(1)
print("You now have " + str(points) + " point/points")
else:
print()
print("You got the question wrong :(")
print()
print("You have " + str(points) + " point/points")
#This last part gives the user a reward if they met the requirments
time.sleep(2)
print("If you earned 3 or more points you win candy")
print()
print("You got " + str(points) + " point/points")
time.sleep(1)
print()
if points >= 3:
print("YOU WON THE CANDY!")
else:
print("Better luck next time")