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 (2016, retired 2019) Slices sillyCase

Chastin Davis
PLUS
Chastin Davis
Courses Plus Student 2,299 Points

I am not understanding how this can be done. How can I create a string that has half its char lowercase and half upper?

I believe I am to use a function and use slices in that function to accomplish this.

sillycase.py
def sillycase(cases):

1 Answer

One way I can think of is using the len() function, division operator, index slicing (string[:2], string[2:]), and the string.upper() and string.lower() methods.

let me know if you still need help. :)