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()

connor hoare
connor hoare
7,933 Points

Can any one help with this please? Input() code challenge for Python?

I cant seem to work this out? What am i doing wrong?

age.py
age = input("What is your age?")
David Dooley
David Dooley
3,028 Points

Try this, notice the semi colon

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

Hey David,

I just thought I would add that in Python the use of a semi colon is not needed to terminate a line of code.

It is used more as a separator so there can be multiple statements on the same line.

an example would be: print x; print y; print z

The problem is just that there is no space between ? and ". Hope that helps!

3 Answers

Andrey Misikhin
Andrey Misikhin
16,529 Points

It works. You must execute it from console with command "python age.py".

Hi Connor

I think your problem is that you've just not added a space at the end.

age = input("What age are you? ")

Everything else looks correct though.

Indy Subasic
Indy Subasic
5,401 Points

Connor, not sure if I am seeing acurately, however it seems that you have a space between input and (