Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

connor hoare
connor hoare
7,932 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 = 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 (