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 trialfrank sebring
1,037 PointsThe code generates the correct answer but it will not accept my answer as correct. Can someone please tell me why.
I need you to create a new function for me. This one will be named sillycase and it'll take a single string as an argument. sillycase should return the same string but the first half should be lowercased and the second half should be uppercased. For example, with the string "Treehouse", sillycase would return "treeHOUSE".
def sillycase():
user_word = input("Type a word in: ")
user_word2 = user_word.lower()
user_word3 = list(user_word2)
size = len(user_word3)
x = size // 2
user_word4 = user_word3[x:]
user_word5 = user_word3[0:x]
user_word6 = "".join(user_word5) + "".join(user_word4).upper
4 Answers
james south
Front End Web Development Techdegree Graduate 33,271 Pointsit will PRINT the correct answer, the challenge wants you to return it.
james south
Front End Web Development Techdegree Graduate 33,271 Pointsyou're missing the parens () on upper and then you aren't returning anything.
frank sebring
1,037 PointsI added the () to the upper and one more line of code.
print(user_word6)
This still shows up as incorrect. If I run it on my computer the program will generate the correct answer.
Alexander Davison
65,469 PointsAlso, the challenge never asked for user input. You should be taking in a parameter.
frank sebring
1,037 Pointsfrank sebring
1,037 PointsThanks man. I had not paid much attention to return vs print until now. Didn't really understand what the differences were.