Python Forum
Simple modular Programm
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple modular Programm
#2
Quote:
          run="true"                                        
          while run=="true":                                
              a=input(line)                                 
              line=line+1                                   
              if a=="//end":                                
                  run="false" 

Why is run a string? There's a boolean type that's perfect for this:
run = True
while run:
    # do something
    if #some condition :
        run = False
Reply


Messages In This Thread
Simple modular Programm - by Solstice - Dec-29-2017, 07:35 PM
RE: Simple modular Programm - by nilamo - Dec-29-2017, 09:00 PM
RE: Simple modular Programm - by buran - Dec-29-2017, 09:02 PM
RE: Simple modular Programm - by sparkz_alot - Dec-29-2017, 09:13 PM
RE: Simple modular Programm - by Solstice - Dec-29-2017, 10:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Small programm to change names of files Brotato 0 1,832 Aug-20-2020, 08:12 PM
Last Post: Brotato

Forum Jump:

User Panel Messages

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