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 Input

quiz 1 input not working

When trying to answer this question for the quiz. I thought the answer would be "input(" turns out I was incorrect. I even went back to the video. Can someone show me the way please?

3 Answers

Omar Farag
Omar Farag
4,573 Points

To gather input from the user, you use input(), which is already done for you. The question is asking you to convert the input into an INTEGER, which means you have to use the int() method. Hope this helps

yeah i tried that and it didnt work

Aaron Nolan
Aaron Nolan
5,714 Points

Treehouse wants you to store the input as an integer as age would be a number.

So input returns a string and then you need to cast it to an integer like so :

age = int(input("What is your age? "))
Nick Cannariato
Nick Cannariato
25,823 Points

You're not wrong, Roland. The way the question is phrased and the code is laid out, it appears that you need to write:

int( 

In the blank in order to complete the code correctly. However, after banging my head against it for a while, the answer is actually just to write int in the blank without the opening parenthese. You had the correct answer, but the formatting of the question is definitely a bit weird.

I reported the question to Treehouse, but wanted to drop this comment here so you knew how to proceed if you were still stuck.