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 trialOng Jia Rui
1,731 PointsWeird Error
Bummer! HeMGIUPhpaNuftcWKYXTGJDYSSQMOVBKANZ;;;hemgiuphpanuftcwkYXTGJDYSSQMOVBKANZ Restart
def sillycase(word):
mid = int(len(word)/2)
new_word = [0, 1]
new_word[0] = word[:mid-1]
new_word[1] = (word[mid-1:]).upper()
return "".join(new_word)
Jason Anello
Courses Plus Student 94,610 PointsI think the string before the semi-colons is what your function is producing and the string after is what it's expecting.
I'll let the staff know that it's not formatted properly.
Jason Anello
Courses Plus Student 94,610 PointsThe error message has been fixed. It will now read "Didn't get the right output from sillycase
." for the code that you have.
2 Answers
Andrew Voitsekhovskyy
3,523 PointsFirstly try
mid = int(len(word)/2.0)
Jason Anello
Courses Plus Student 94,610 PointsHi Ong Jia Rui ,
Try tracing through your code with the example "Treehouse" string and see if you get the expected result of "treeHOUSE"
See if you're slicing at the correct index.
Also, you're upper-casing the second half but what about the first half?
Steven Parker
231,236 PointsSteven Parker
231,236 PointsYou might want to report that one to Support.