Python Forum
How to use while true/while loop on python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use while true/while loop on python
#3
What do you want to accomplish?

This code will endlessly print APPLE:

i = 'APPLE'
while True:
    if i == 'APPLE'
        print(i)         # Ctrl + C to cancel
Python has built-in help, type help('while') into your interactive interpreter and you will have official documentation at your disposal (press Q to quit help).
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: How to use while true/while loop on python - by perfringo - Oct-07-2019, 01:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  While True loop help Nickd12 2 2,027 Oct-17-2020, 08:12 AM
Last Post: Nickd12
  Is using while True loop good? escape_freedom13 5 3,627 Jul-03-2020, 08:27 PM
Last Post: escape_freedom13
  Do break operators turn while loop conditions from True to False? Drone4four 5 3,059 Oct-24-2019, 07:11 PM
Last Post: newbieAuggie2019
  Returning True or False vs. True or None trevorkavanaugh 6 9,411 Apr-04-2019, 08:42 AM
Last Post: DeaD_EyE
  file.write stops while true loop from executing in python3 boonr 3 3,179 Mar-25-2019, 12:50 PM
Last Post: ichabod801
  How to make loop go back to the beginning if test evaluaes to True. FWendeburg 1 2,869 Feb-13-2019, 01:26 AM
Last Post: stullis
  Returning true or false in a for loop bbop1232012 3 8,236 Nov-22-2018, 04:44 PM
Last Post: bbop1232012
  Get True of false outside a loop morgandebray 2 2,505 Aug-09-2018, 12:39 PM
Last Post: morgandebray

Forum Jump:

User Panel Messages

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