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) Slices sillyCase

George Lugo
seal-mask
.a{fill-rule:evenodd;}techdegree
George Lugo
Python Web Development Techdegree Student 922 Points

ok so I did this and I do not understand why it is not passing through. Do i have to make it for any string?

def sillycase(string): string = "John" return string.lower([:2]) return string.upper([2:])

sillycase.py
def sillycase(string):
    string = "John"
    return string.lower([:2]) 
    return string.upper([2:])

1 Answer

after

    return string.lower([:2]) 

The function will return that value and not run the rest of your code, so in order to make this work you can create a new variable in which you store each half and then return the two concatenated