Can you make this code prompt twice in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

19th Apr 2021, 10:26 PM
Steve Nova
Steve Nova - avatar
2 Answers
+ 2
Initialize i = 6 and move i = i + 1 into the if block.
19th Apr 2021, 10:51 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Thanks CarrieForle it is working fine now 🤞
19th Apr 2021, 11:04 PM
Steve Nova
Steve Nova - avatar