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

Why doesnt the lower function work for the input statement?

I got an error for the following code but it says the input is not defined. I feel my logic is right but I am not sure what im missing.

first_name = lower(input("What is your name? "))

Here a good link to lower() method documentation.

1 Answer

Hi Abdullah,

I would suggest doing it this way.

first_name = input("What is your name? ").lower()

The input method will store users input as a string object in first_name. String objects have properties like the upper() and lower() methods. You can use dot notation on the first_name instead of passing input as a parameter. Also, I am not aware of a standalone lower() method that takes a string as an input or any other parameter.

Does this answers your question?

Thank you that helps.