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 trialAshley Keeling
11,476 PointsI don't know how to do this question
it says
Bummer! Be sure to use integers for indexes. int()
or //
will be needed!
def sillycase(st):
x=list(st)
y=x/2
return str[ :y].lower() + str[y:].upper()
2 Answers
Chris Freeman
Treehouse Moderator 68,453 PointsWhile adding the second division slash is important, there are a few more errors
- in calculating
y
, you need to use thelen(x)
instead ofx
- in the
return
statement, the built-in functionstr
should be the parameterst
instead
Post back if you need more help. Good luck!!!
Steven Parker
231,269 PointsDivision generates floats by default, but the "//" operator is the special "integer division" operator:
y=x//2
And as the challenge hinted, you could also pass the entire expression as the argument to "int()".
Ashley Keeling
11,476 PointsI have put two divide symbols in, and it still says the same thing
Ashley Keeling
11,476 PointsAshley Keeling
11,476 PointsTHANKS I completed the challenge thanks for the help