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

Python Python Collections (Retired) Slices sillyCase

What string should i use? I find this problem frequently.Where will it tell me what is the desired output is?

I don't know what string to use. In the objectives it says use "a string". What string? I found this problem in a previous objective too. it wanted me to skip the odd index in "Oklahoma" but it didn't tell me what string to use. Thanks.

silly.py
# 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):
  wrd="supercalifragiolousdigexpialidocious"

1 Answer

Dan Johnson
Dan Johnson
40,532 Points

The string you'll be using is whatever is passed into your sillycase function. You've named the argument word so that's the variable you'll be working with.

Since you won't know what the contents are, you'll want to use functions like len to determine properties of the string so you can find the center and split it. Then apply the upper and lower methods, concatenate the two parts, and return it back.