0
Can anyone help to make this code work?
I developing a quiz for children and I want the the code to say ("Incorrent, Answer is 12") only in the last attempt. After 3 attempts print("Incorrent, Answer is 12") Is there anyway to do this? print('Enter correct Answer') count=0 while count < 3: ques1 = int(input("What is 3 x 4: ")) if ques1==12: print("Correct") if count>=3: print("Incorrent, Answer is 12") break else: print("Incorrent") count += 1 https://code.sololearn.com/cA8zS5Qgz5cu/?ref=app
3 Réponses
+ 2
# something like this?
# Created by Steve Nawa 🇳🇦
print('Enter correct Answer')
count=0
no_of_try = 3
while count < no_of_try:
ques111 = int(input("What is 3 x 4: "))
if ques111==12:
print("Correct")
if count>=no_if_try:
print("Incorrent, Answer is 12")
break
elif count==no_of_try-1:
print("\nIncorrent, Answer is 12")
break
else:
print("Incorrent")
count += 1
+ 1
Niiice work thanks so much. 🤞✌️
+ 1
you're welcome, happy learning :)