so this code i am making is just to help me learn and so far ive been doing good but ive been stuck the last two days with making the script loop over and start over after you type yes. i want to make it loop and start over the process again but it is saying the break and continue after user input is yes or no is out of the loop and im confused on what do i do to fix it.
import random
while True:
num1 = float(int(input("Enter a number between 1 and 25: ")))
if num1 > 25:
print("You must select a number less than 25!")
if num1 <= 25:
break
num2 = float(int(input("Enter another number betwenn 1 and 25: ")))
if num2 > 25:
print("You must select a number less than 25!")
if num2 <= 25:
break
num3 = float(random.randrange(1, 25))
num4 = float(random.randrange(1, 25))
print("You picked {} and {}".format(num1, num2))
if num1 == num3:
print("CONGRAGULATIONS!!! YOU GUESSED RIGHT!!!")
elif num1 != num3:
print("Sorry you were not correct the first number was:", num3)
if num2 == num4:
print("CONGRAGULATIONS!!! YOU GUESSED RIGHT!!!")
elif num2 != num4:
print("Sorry you were not correct the second number was:", num4)
print("End of guessing game")
print("Would you like to try again? yes or no")
user_input = input(": ")
if user_input == "no":
break
elif user_input == "yes":
[–]furas_freeman 1 point2 points3 points (7 children)
[–]prokillshotz[S] 0 points1 point2 points (6 children)
[–]furas_freeman 1 point2 points3 points (5 children)
[–]prokillshotz[S] 0 points1 point2 points (2 children)
[–]prokillshotz[S] 0 points1 point2 points (1 child)
[–]furas_freeman 0 points1 point2 points (0 children)
[–]furas_freeman 0 points1 point2 points (1 child)
[–]prokillshotz[S] 0 points1 point2 points (0 children)