Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Infinite loop
#8
Each time the code is repeated in the loop, suma gets set to 0. You will need to put suma = 0 outside of while loop.

Sure it prints only input request. There is no print statement in the "if" that would print anything, until next loop iteration.
Reply


Messages In This Thread
Infinite loop - by Truman - Jan-18-2018, 10:54 PM
RE: Infinite loop - by Larz60+ - Jan-18-2018, 10:57 PM
RE: Infinite loop - by Truman - Jan-18-2018, 11:03 PM
RE: Infinite loop - by Larz60+ - Jan-19-2018, 12:02 AM
RE: Infinite loop - by Truman - Jan-19-2018, 10:37 PM
RE: Infinite loop - by buran - Jan-19-2018, 12:14 PM
RE: Infinite loop - by wavic - Jan-19-2018, 12:34 PM
RE: Infinite loop - by j.crater - Jan-19-2018, 10:49 PM
RE: Infinite loop - by Truman - Jan-19-2018, 11:22 PM
RE: Infinite loop - by j.crater - Jan-19-2018, 11:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Infinite loop Danado 4 2,438 Aug-16-2021, 05:56 PM
Last Post: deanhystad
  Help with while loop creating an infinite loop. FWendeburg 3 3,153 Jan-30-2019, 08:28 PM
Last Post: FWendeburg
  Infinite loop/ only half working anclark686 5 4,862 Sep-09-2018, 07:31 AM
Last Post: buran
  Why is this giving me an infinite loop? wlsa 4 4,014 Jul-25-2018, 10:11 PM
Last Post: cyberpatje
  Another infinite loop wlsa 7 4,802 Jul-20-2018, 12:04 AM
Last Post: wlsa
  How to stop an infinite loop in spyder if it's currently running? wlsa 3 24,841 Jun-30-2018, 03:27 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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