Python Forum
while loop not working-I am using sublime text editor
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
while loop not working-I am using sublime text editor
#2
Please post code in bb tags to hold formatting.

Maybe something like this

print('Please enter the name of cities.\nEnter quit when finished')
while True:
    city = input('>> ')
    if city.lower() == 'quit':
        print('Goodbye!')
        break
    else:
        print(f'I\'d love to go to {city.title()}.')
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Messages In This Thread
RE: while loop not working-I am using sublime text editor - by menator01 - Feb-03-2023, 07:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Text conversion to lowercase is not working ineuw 3 543 Jan-16-2024, 02:42 AM
Last Post: ineuw
  Decryption not working if key has same symbol like text Paragoon2 0 348 Nov-11-2023, 09:32 PM
Last Post: Paragoon2
  ANSI not working for change of text colors BliepMonster 10 3,532 Nov-10-2022, 09:28 AM
Last Post: BliepMonster
  Sublime Text Editor not recognizing Python elroberto 5 2,999 Jun-13-2022, 04:00 PM
Last Post: rob101
  WHILE Loop - constant variables NOT working with user input boundaries C0D3R 4 1,540 Apr-05-2022, 06:18 AM
Last Post: C0D3R
  Skipping line in text without Restarting Loop IdMineThat 4 1,551 Apr-05-2022, 04:23 AM
Last Post: deanhystad
  Music Notation editor; how to build the editor? direction to go? philipbergwerf 1 1,755 Jan-01-2022, 04:56 PM
Last Post: Larz60+
  Code folding in Sublime Text Mondata 2 2,853 Mar-12-2021, 04:16 PM
Last Post: Mondata
  How to link Sublime Text 3 Build system to Python 3.9 Using Windows 10 Fanman001 2 4,681 Mar-04-2021, 03:09 PM
Last Post: martpogs
  Sublime Text TechNitium 4 2,820 Jan-23-2021, 08:41 AM
Last Post: TechNitium

Forum Jump:

User Panel Messages

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