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

sillycase

Yeah so, I don't get why this doesn't work. Several tests done including the "treehouse is awesome" thing that I saw in another question and it worked correctly soooo /shrug.

sillycase.py
def sillycase(locomotive):
    string = locomotive
    word = locomotive
    letters = len(word)
    number = (int(letters))/2
    word1 = word[:int(number)].lower()
    word2 = word[int(number):].upper()


    print(word1 + word2)

1 Answer

Steven Parker
Steven Parker
231,269 Points

The instructions say that the function should return the string. It doesn't need to print anything.

and it was that simple..... lol I use the actual python software to type my stuff up to make sure it works there and when I copied it over I didn't change that...

thanks much! the : at the end of a function has been my downfall many times as well...