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

Piyush Patel
Piyush Patel
17,253 Points

Don't understand the last question

I am not sure what the reversed mean? Is it asking for str = "hello hi how are you" to result in "you are how hi hello"

I tried it but didn't work with this code.

stringcases.py
import string
def stringcases(str):
    str_list = str.split()
    str_list.reverse()
    str2 = " ".join(str_list)
    return str.upper(), str.lower(), string.capwords(str), str2

1 Answer

I would expect that it means "hello world" becomes "dlrow olleh" given that each other requirement is applied to the string as a whole?

Piyush Patel
Piyush Patel
17,253 Points

Ok Thank you it worked out.