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 trialIvan K
1,928 PointsHi all, I done that excersice, but faces with error when I try to execute script in your site
Hi, in my Terminal it works cool, but in your web site environment I faced with error when try to execute it regarding "sillycase" task.
def sillycase(): word = 'Treehouse' a = (word[0:int(len(word)/2):1]) b = (word[-int(len(word)/2)::1]).upper() print(a+b) sillycase()
# 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"
def sillycase():
word = 'Treehouse'
a = (word[0:int(len(word)/2):1])
b = (word[-int(len(word)/2)::1]).upper()
print(a+b)
sillycase()
2 Answers
Alexander Davison
65,469 PointsTwo things that might've confused you:
- The code challenge automatically calls the function. It just causes an error in the code challenge if you do so :)
- Also, your function is actually just returning
None
, and it's not the thing you expect the function to return. This is because youprint
ed the output, and didn't return it
To fix these, do these steps:
- Get rid of the
sillycase()
line of code (the line where you call the function) - Change
print(a+b)
toreturn a+b
.
Good luck! ~alex
Rob Allessi
8,600 PointsHey Alexander Davison would you please email us at help@teamtreehouse.com with a description of the issue you are facing when you attempt to access a code challenge? Screenshots would be very helpful as well.
Ivan K
1,928 PointsIvan K
1,928 Pointsthanks!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsYour welcome! Can you give me a
Best Answer
so others in the Community know this is answered? Thank you very much! ~alexJason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Alexander,
It's a good idea to run through the challenge with your suggested fixes to make sure it's correct.
I don't know if you'd like to check the challenge again and revise your answer but there are more things wrong with the original code.
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsOh yeah. Code challenges are broken for me, so sadly I can't check...
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsWhat do you mean? You can't access any code challenge?
Have you emailed support about this?
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsYep. I can't access any code challenge, but I think it's because I'm using Ubuntu.