Python Forum
Code won't break While loop or go back to the input?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code won't break While loop or go back to the input?
#2
First off; don't use Python key words as names for your variables.

So, use user_input = int(input('Number? ')) or some such.

Also number_list = []

Second; while True: will never fail (as is), so you'll simply keep on appending the number to the number list; I won't say forever, because at some point, something will crash (possibly), but it'll take some time.

If you need any more help, post back.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
RE: Code won't break While loop or go back to the input? - by rob101 - Oct-26-2022, 10:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  WHILE LOOP NOT RETURNING USER INPUT AFTER ZerroDivisionError! HELP! ayodele_martins1 7 1,210 Oct-01-2023, 07:36 PM
Last Post: ayodele_martins1
Question in this code, I input Key_word, it can not find although all data was exact Help me! duchien04x4 3 1,162 Aug-31-2023, 05:36 PM
Last Post: deanhystad
  How to break out of a for loop on button press? philipbergwerf 6 1,905 Oct-06-2022, 03:12 PM
Last Post: philipbergwerf
  Help Switching between keyboard/Mic input in my code Extra 1 1,154 Aug-28-2022, 10:16 PM
Last Post: deanhystad
  break out of for loop? User3000 3 1,546 May-17-2022, 10:18 AM
Last Post: User3000
  WHILE Loop - constant variables NOT working with user input boundaries C0D3R 4 1,587 Apr-05-2022, 06:18 AM
Last Post: C0D3R
  Asyncio: Queue consumer gets out of while loop without break. Where exactly and how? saavedra29 2 2,797 Feb-07-2022, 07:24 PM
Last Post: saavedra29
  "while" loop is looping back too early mangurian 1 1,353 Jan-28-2022, 09:15 AM
Last Post: ibreeden
Exclamation question about input, while loop, then print jamie_01 5 2,793 Sep-30-2021, 12:46 PM
Last Post: Underscore
  tkinter control break a while loop samtal 0 2,471 Apr-29-2021, 08:26 AM
Last Post: samtal

Forum Jump:

User Panel Messages

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