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 trialRonnie Barua
17,665 Pointswhat'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
Treehouse Guest TeacherYour function only has one line in it. You need to indent the rest of the function.
Ronnie Barua
17,665 PointsThanks! I was lucky enough to fix it by indenting.
Jordan Gumm
467 PointsJordan Gumm
467 PointsExactly. 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