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

Todd Anderson
Todd Anderson
4,260 Points

Stringcases: When I return a single tuple with each str type in it, I get an error Wrong string(s) for:

Do I need to return a tuple with "All uppercase", uppercase string? The original string with a tuple of each str format?

def stringcases(str):
         return str.upper(), str.lower(), str.capitalize(), str[::-1]

This gives me the desired outcome in a python shell. Is the question just poorly worded and I'm not fulfilling other requirements because this definitely returns a tuple with all string formats asked for.

2 Answers

Robert Ionut Muraru
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Robert Ionut Muraru
Full Stack JavaScript Techdegree Graduate 22,194 Points

You are using the wrong method, 'capitalize()' is not what it is asked for. You should use a method that capitalizes the first letter of every word in your string.

You can type help(str) for the class help messages. This should give you the method for the .title(case) that the challenge asks for. ;)