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 trialJennifer Sherwood
896 PointsError says "int() or // will be needed". I've tried both but still getting the error.
I've written this challenge about 10 different ways but keep getting the same error. I tried running it on a different rpl and it worked. Please advise.
def sillycase(string):
half_length = int(len(string) / 2)
string_left = string[:half_length]
string_right = string[half_length:]
sillycase_string = string_left.lower + string_right.upper
return sillycase_string
3 Answers
diogorferreira
19,363 PointsThe errors is that you have to call the functions, you can't just add them. So it would have to be both .upper() and .lower()
def sillycase(string):
half_length = int(len(string) / 2)
string_left = string[:half_length]
string_right = string[half_length:]
sillycase_string = string_left.lower() + string_right.upper()
return sillycase_string
Hope it helps!
diogorferreira
19,363 PointsI'm not sure what is wrong then, whenever I try your code with the changes it passes the challenge?
Jennifer Sherwood
896 PointsWhat I mean is, that I don't understand what you're telling me to do in your first response, therefore I can't make the changes to pass the challenge.
I tried what I thought you meant and I got "can't find sillycase"
Jennifer Sherwood
896 PointsSMH - I knew I was tired last Friday. Three minutes back at it, I see what I was missing ().
Jennifer Sherwood
896 PointsJennifer Sherwood
896 PointsI'm sorry, but I don't think I know what you mean. I thought I did but what I tried didn't work.