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

Bummer! Got the wrong string(s) for: Uppercase, Lowercase

I do not understand why my codes got the bummer. My IDE test to the function is perfect def stringcases(myString): tup = (myString.lower(), myString.upper(),myString.title(), myString[::-1]) return tup

tt = "deLT1 3oUU" print(stringcases(tt))

('delt1 3ouu', 'DELT1 3OUU', 'Delt1 3Ouu', 'UUo3 1TLed')

stringcases.py
def stringcases(myString):
    tup = (myString.lower(), myString.upper(),myString.title(),  myString[::-1])
    return tup

2 Answers

andren
andren
28,558 Points

The instructions specify the first string should be uppercased and the second lowercased. You do the opposite.

If you simply switch the first two strings like this:

def stringcases(myString):
    tup = (myString.upper(), myString.lower(),myString.title(),  myString[::-1]) # lower changed to upper and vice versa
    return tup

Then your code will work.

My mistake. Thanks