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
Abdullah Jassim
4,551 PointsWhy 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? "))
1 Answer
Grigorij Schleifer
10,365 PointsHi 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?
Abdullah Jassim
4,551 PointsThank you that helps.
Grigorij Schleifer
10,365 PointsGrigorij Schleifer
10,365 PointsHere a good link to lower() method documentation.