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

Ronnie Barua
Ronnie Barua
17,665 Points

what's wrong with this?

def sillycase(silly):
  length = len(silly)
half = int(round(length/2.0))
str1 = silly[:half].lower()
str2 = silly[half:].upper()
return str1 + str2

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Your function only has one line in it. You need to indent the rest of the function.

Exactly. Python uses indentation to logically separate (and in this case correctly parse) different parts of a program. In most languages this is considered good coding practice (convention), but for Python it's actually required. http://en.wikipedia.org/wiki/Python_syntax_and_semantics

Ronnie Barua
Ronnie Barua
17,665 Points

Thanks! I was lucky enough to fix it by indenting.