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 trialRoja kajoka
701 Pointshelp please
help me
def sillycase (single):
name[-2:] = single
new = int(name[-2:])/2
go = new.lowecase + new.uppercase
return go
1 Answer
jano koku
Courses Plus Student 160 PointsHi!
This is my solution
def sillycase(single):
firstHalf = single[:len(single) // 2]
secondHalf = single[len(single) // 2:]
go = firstHalf.lower() + secondHalf.upper()
return go
As you can see, the way to lowercase a string is with the function lower(), and upper() to uppercase a string. Then when you slice the string, you can slice the first half by starting at the start of the string and ending at the rounded half index with len(single). To get the second half you instead start at the rounded half index with len(single) and stop at the end of the string.