Python Python Collections (2016, retired 2019) Slices sillyCase

Sillycase.py

I've had a go and tried three different variations yet I keep on getting a bummer!

A little help wouldn't go amiss on this one.

sillycase.py
def sillycase (word):

    midpoint = len(word) // 2

    word1 = word[:midpoint].lower()
    word2 = word[midpoint:].upper()

    return word1 + word2 

1 Answer

Grigorij Schleifer
Grigorij Schleifer
10,352 Points

Hey Sam, your code works fine. Reload the page and paste the code again. I just tried it and it passed the challenge.

You can save some typing by modifying the return statement too :sunglasses:

def sillycase(word):
    midpoint = len(word)//2
    return word[:midpoint].lower() + word[midpoint:].upper()

Hope that helps ...