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 Collections (2016, retired 2019) Tuples Stringcases

Sahil Kapoor
Sahil Kapoor
8,932 Points

Can't understand the question properly

THE QUESTION IS ....... : Create a function named stringcases that takes a single string but returns a tuple of different string formats. The formats should be: All uppercase All lowercase Titlecased (first letter of each word is capitalized) Reversed There are str methods for all but the last one.

stringcases.py
def stringcases(string):

1 Answer

Shreyas Papinwar
Shreyas Papinwar
2,371 Points

The question is really easy - if we give the function "a string" it must return in tuple with these format - ("A STRING", "a string", "A String") # this is a tuple

I won't give you the code but its easy try to think of it, you just have the change the string in return it has a tuple.

GOOD LUCK!