Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
blank space + input()
#1
Hi, how do make it so that a blank space precedes an input() function, and even more specifically, how would I make it so that this applies only to the final line?

text = ''
while text != 'quit':
    text = input('Please enter a number (or \'quit\' to exit):')
    if text == 'quit':
        print('...exiting program')
    elif text.isnumeric() == True:
            print(x + 2)
    elif text.isnumeric() == False:
        print('That is not a number.', end = '')
What I want to fix (look how it's all smudged together):
Please enter a number (or 'quit' to exit):j
That is not a number.Please enter a number (or 'quit' to exit):
Reply


Messages In This Thread
blank space + input() - by ClassicalSoul - Mar-05-2019, 02:15 AM
RE: blank space + input() - by Larz60+ - Mar-05-2019, 02:39 AM
RE: blank space + input() - by ichabod801 - Mar-05-2019, 02:41 AM
RE: blank space + input() - by perfringo - Mar-05-2019, 11:21 AM
RE: blank space + input() - by ClassicalSoul - Mar-05-2019, 05:38 PM
RE: blank space + input() - by ichabod801 - Mar-05-2019, 06:39 PM
RE: blank space + input() - by perfringo - Mar-06-2019, 09:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why the blank lines in output? Mark17 6 2,508 Jun-27-2022, 11:21 PM
Last Post: Mark17
Exclamation Why there's a 'blank line' on CSV file? brunolelli 4 4,739 Mar-25-2021, 03:43 AM
Last Post: buran
  from global space to local space Skaperen 4 3,162 Sep-08-2020, 04:59 PM
Last Post: Skaperen
  Verify input as integer and not blank GMCobraz 3 2,857 Jun-22-2020, 02:47 PM
Last Post: pyzyx3qwerty
  CSV gives me blank row on PC, but not a Mac bazcurtis 2 3,600 Jan-06-2020, 08:40 AM
Last Post: buran
  How to recognize space or enter as one-character input? Mark17 5 8,662 Oct-17-2019, 08:19 PM
Last Post: jefsummers
  Pygsheets Keeps inserting a blank row, Need Help HiImNew 1 3,927 Jan-26-2018, 08:48 AM
Last Post: buran

Forum Jump:

User Panel Messages

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