Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJenna Thompson
759 PointsWhat is a trailing space?
I'm trying to do the input challenge, when i submit my code it, it says to add in a trailing space. What is that?
age = input("What is your age?")
1 Answer
Alexander Davison
65,469 PointsYou need a space after the question mark.
Currently if the user inputs, it will look like this:
What is your age?28
To put a space between user input and the message, you have to explicitly put it after the question mark.
To fix your code, just do the following:
age = input("What is your age? ")
Notice the space after the question mark. Now when the user inputs it looks much nicer:
What is your age? 28
(28 isn't my age it's just a random age)
Good luck! ~alex
Jon Helmus
7,312 PointsJon Helmus
7,312 PointsYou need to add a trailing space between the question mark and the final parenthesis.
try this.
age = input("What is your age? ")