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

Paul Heneghan
Paul Heneghan
14,380 Points

If I run this code outside of a function, it works. But as a function it doesn't return anything when called.

myString = "Treehouse" def sillycase(myString): lower_silly = myString[0:round(len(myString)/2)].lower() upper_silly = myString[round(len(myString)/2):].upper() print(lower_silly + upper_silly)

sillycase(myString)

silly.py
# The first half of the string, rounded with round(), should be lowercased.
# The second half should be uppercased.
# E.g. "Treehouse" should come back as "treeHOUSE"
myString = "Treehouse"
def sillycase(myString):
    lower_silly = myString[0:round(len(myString)/2)].lower()
    upper_silly = myString[round(len(myString)/2):].upper()
    print(lower_silly + upper_silly)

sillycase(myString)

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

You are 100% correct. It doesn't return anything. It prints the result :smiley: If I copy/paste your code, and change the print to the word return, the challenge passes! :sparkles:

Paul Heneghan
Paul Heneghan
14,380 Points

How loud can I say it? D'oh!

Thank you so much, JN!