¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
Can you make this code prompt twice in python
Can you make "What is 3x6?" prompt twice when ever I intensionally give it a wrong answer? so that it prompts again. i = 5 count=0 no_of_try = 3 while count < no_of_try and i <= 7: i = i + 1 # What is 3x6, 3x7 and 3x8 ques1 = int(input("What is 3 x {}: ".format(i))) if ques1==3*i: print("{} is Correct.".format(ques1)) elif count==no_of_try-1: print("\nIncorrent, Answer is {}.".format(3*i)) break else: print("Incorrent.\n") count += 1 # https://code.sololearn.com/cA8zS5Qgz5cu/?ref=app
2 Respuestas
+ 2
Initialize i = 6 and move i = i + 1 into the if block.
0
Thanks CarrieForle it is working fine now 🤞