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

Please help me with this python challenge

Create a function named sillycase that takes a string and returns that string with the first half lowercased and the last half uppercased.

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():

1 Answer

Jeremy Fisk
Jeremy Fisk
7,768 Points

a few steps to follow to include in your function:

1) find the len of your string 2) after you have the len , determine the middle point of the string (mathematically) 3) use the round function on the midpt to determine the last character for the first half of the string 3) perform the lower() string function on the first half 4) perform the upper() string function on the second half 5) ensure the lower and uppercase parts are concatenated back together, depending on your approach