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 trialCaroline Louw
12,155 Pointswhat if the user types in help or show in lowercase. where do I change the code to accommodate that change?
or is there no need for that? Like in the last video for list in the python track.
2 Answers
Jeff Muday
Treehouse Moderator 28,722 PointsSimple to do-- if you include the string method upper()
after new_item
like the code snippet below, you can treat lower case or mixed case inputs as if these were typed in as upper case.
Hope this helps!
if new_item.upper() == 'DONE':
break
elif new_item.upper() == 'HELP':
show_help()
continue
Christian Beckett
11,123 Pointswhat you require is a string upper after new_item
if new_item.upper() == 'DONE":
break
elif new_item.upper() == 'HELP':
show_help()
continue
Sandy Hadley
4,463 PointsThis will also do it:
new_item = input("> ").upper()