Python Forum
Calculator exceptions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculator exceptions
#6
Hint: there are two ways to exit a while loop. The classic way according to the rules of Stuctured Programming is to use a condition:
answer = "y"
while answer == "y" :
    # do your thing
   answer = input("Start again? y/n ")
Or else you can break from the loop.
while True:
    # do your thing
    answer = input("Start again? y/n ")
    if answer == "n":
        break
Let us know how you solved it.
Reply


Messages In This Thread
Calculator exceptions - by HereweareSwole - Jun-29-2021, 04:30 AM
RE: Calculator exceptions - by Yoriz - Jun-29-2021, 06:09 AM
RE: Calculator exceptions - by HereweareSwole - Jul-01-2021, 04:24 AM
RE: Calculator exceptions - by ibreeden - Jun-30-2021, 08:00 AM
RE: Calculator exceptions - by ibreeden - Jul-01-2021, 07:32 AM
RE: Calculator exceptions - by ibreeden - Jul-03-2021, 08:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  writing user exceptions ccm1776 1 2,634 Oct-04-2018, 07:36 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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