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
  from global space to local space Skaperen 4 2,334 Sep-08-2020, 04:59 PM
Last Post: Skaperen
  Verify input as integer and not blank GMCobraz 3 2,140 Jun-22-2020, 02:47 PM
Last Post: pyzyx3qwerty
  CSV gives me blank row on PC, but not a Mac bazcurtis 2 2,800 Jan-06-2020, 08:40 AM
Last Post: buran
  How to recognize space or enter as one-character input? Mark17 5 5,650 Oct-17-2019, 08:19 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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