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

seong lee
seong lee
4,503 Points

can someone tell me what i am doing wrong. Thank you in advance

I do not understand what I am doing wrong can someone please tell me

sillycase.py
def sillycase(argu):
    uther = int(argu[0:2]).lower
    arthur = int(argu[2:]).upper
    ret = (uther, arthur)
    return ret

1 Answer

Kevin Brennan
Kevin Brennan
19,920 Points
def sillycase(astring):
    half = len(astring)//2
    return astring[:half].lower() + astring[half:].upper()

Hi Seong,

The challenge asked for the first half a string to be returned in lowercase and the second half in uppercase. To do this you need to use the len() function and divide the answer by two using integer division. You then just use that figure in your slices. Hope that helps.

seong lee
seong lee
4,503 Points

Wow, I was way off from what I needed to do. Thank you. I will always remember this at all times.