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 trial

Python Python Basics (2015) Logic in Python Use input()

Kwun Kit Lau
Kwun Kit Lau
1,260 Points

why age = int(input("What is your age?" )) does not work?

age = int(input("What is your age?" ))

age.py
age = int(input("What is your age?" ))

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

They hint that they want a trailing space in the details of the challenge instructions. What they mean is that they want a space between your question mark and end quotes. If I copy/paste your code and add that space, it passes! Here's a look at your code with the added space:

age = int(input("What is your age? " ))
Carlos Federico Puebla Larregle
Carlos Federico Puebla Larregle
21,073 Points

It is because is not asking for you to use the "int()" function. Just use the input() function like this:

age = input("What is your age? ")

I hope that helps