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
Michael Johnson
862 PointsThis code works in my interpreter just fine. Why is the automated correcter rejecting it?
I assume I have to go about doing this another way. I think I'm doing something not quite right. Maybe using a different function or method? Anyway, the automated correcter doesn't like the way I went about getting the answer. Thanks in advance!
<p>This is code!</p>
def sillycase(werd):
length=len(werd)
half= length // 2
word1=slice(werd)
word2=slice(werd)
word1=werd[:half]
word2=werd[half:]
word1="".join(word1).lower()
word2="".join(word2).upper()
retword=word1 + word2
return retword
a=input("Enter a word ")
b=sillycase(a)
print(b)
2 Answers
Steven Tagawa
Python Development Techdegree Graduate 14,438 PointsJust out of curiosity, are you putting all of that code into the challenge, or just the function? The checker probably wouldn't like the last three lines of actual code that you're using to test it in the workspace.
Michael Johnson
862 PointsThank you I was "REALLY" not paying attention or something. Thank you for your help. That solved the problem for me..