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

George Lugo
seal-mask
.a{fill-rule:evenodd;}techdegree
George Lugo
Python Web Development Techdegree Student 922 Points

why isn't this code working

def sillycase(string): Dot = int(len(string / 2) josh = string[:Dot] alison = string[Dot:] return josh.lower() + alison.upper()

sillycase.py
def sillycase(string):
    Dot = int(len(string / 2)
    josh = string[:Dot]
    alison = string[Dot:]
    return josh.lower() + alison.upper()

3 Answers

Stuart Wright
Stuart Wright
41,119 Points

The problem is in your second line. You're very close but look at your parentheses - you have two '(' but only one ')', which will always cause an error. Everything else is correct.

George Lugo
seal-mask
.a{fill-rule:evenodd;}techdegree
George Lugo
Python Web Development Techdegree Student 922 Points

def sillycase(string): Dot = int(len(string / 2)) josh = string[:Dot] alison = string[Dot:] return josh.lower() + alison.upper()

still not working

Stuart Wright
Stuart Wright
41,119 Points

One of your closing parentheses is positioned incorrectly. Think about the order you want to do these operations in. You want to get the length of the string and then divide that number by 2, then convert this number to an integer. You are currently trying to divide the actual string (rather than the length) by 2, which isn't a valid operation.