Python Forum
Another infinite loop
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another infinite loop
#6
or use just one condition, e.g.
while balance > 10**-10: # very very very small number
Another point to be strict - working with money requires 2 decimal points precision (i.e. in real life you cannot substract 150.1234321 from your balance, you will substract 150.12). you may want to check decimal module for this purpose.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Another infinite loop - by wlsa - Jul-19-2018, 12:41 AM
RE: Another infinite loop - by ichabod801 - Jul-19-2018, 01:37 AM
RE: Another infinite loop - by wlsa - Jul-19-2018, 02:03 AM
RE: Another infinite loop - by buran - Jul-19-2018, 03:31 AM
RE: Another infinite loop - by ichabod801 - Jul-19-2018, 06:21 AM
RE: Another infinite loop - by buran - Jul-19-2018, 06:41 AM
RE: Another infinite loop - by ichabod801 - Jul-19-2018, 06:43 AM
RE: Another infinite loop - by wlsa - Jul-20-2018, 12:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Infinite loop Danado 4 2,409 Aug-16-2021, 05:56 PM
Last Post: deanhystad
  Help with while loop creating an infinite loop. FWendeburg 3 3,100 Jan-30-2019, 08:28 PM
Last Post: FWendeburg
  Infinite loop/ only half working anclark686 5 4,812 Sep-09-2018, 07:31 AM
Last Post: buran
  Why is this giving me an infinite loop? wlsa 4 3,976 Jul-25-2018, 10:11 PM
Last Post: cyberpatje
  How to stop an infinite loop in spyder if it's currently running? wlsa 3 24,779 Jun-30-2018, 03:27 AM
Last Post: ichabod801
  Infinite loop Truman 9 9,201 Jan-19-2018, 11:25 PM
Last Post: j.crater

Forum Jump:

User Panel Messages

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