Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yes or No code
#7
def return ()
     #.
     #.
     #.
    while (a>b):
           print("This value is wrong.")
           question=input("Do you want to return to the start? Enter Y for Yes or N for No")
           if (question==Y):
           return()
           break
    else:
        print("The value is right")
return()
The code above is an example. The code to go back to the start of the program is working. The problem is now the indentation of the IF function inside the WHILE function for return() and break working.
Reply


Messages In This Thread
Yes or No code - by doug2019 - Nov-14-2019, 01:30 PM
RE: Yes or No code - by ichabod801 - Nov-14-2019, 01:32 PM
RE: Yes or No code - by doug2019 - Nov-14-2019, 01:53 PM
RE: Yes or No code - by ichabod801 - Nov-14-2019, 01:57 PM
RE: Yes or No code - by doug2019 - Nov-14-2019, 02:29 PM
RE: Yes or No code - by Clunk_Head - Nov-15-2019, 05:09 AM
RE: Yes or No code - by doug2019 - Nov-15-2019, 05:52 AM
RE: Yes or No code - by Gribouillis - Nov-15-2019, 06:53 AM
RE: Yes or No code - by buran - Nov-15-2019, 07:14 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020