River River -4 years ago 112
Python Question

Making Quiz how to allow User to have multiple trys -Python

else:
remaining = trials-i-1
s = '' if remaining == 1 else 's'
if remaining == 0 :
print()


# Thanks Guys Much Appricated

Answer Source
print("*Space Knowledge Quiz*")
print()
print("Question 1:")
print("Who was the first man to set foot on the Moon?")
print()
print("A): Buzz Aldrin")
print("B): Pete Conrad")
print("C): Neil Armstrong")
print("D): Tony Abbot")
print()
trials = 3
for i in range(trials):
    Answer = input("Input your answer here: ")
    if Answer in ('C', 'Neil Armstrong','c'):
        print('!! Great Job !!')
        break
    else:
        remaining = trials-i-1
        s = '' if remaining == 1 else 's'
        print("Oops Try Again? [{0} Chance{1} Remaining]".format(remaining, s))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download