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 trialAbdulkadir Kollere
1,723 PointsBummer! scnGPJDVHILQABF;;;scngpjdVHILQABF
I need help with this part please. I dont know what the error means and I dont see any issue with the code. Anyone for the rescue?
def sillycase(iterable):
one = iterable[:3]
one = one.lower()
two = iterable[3:]
two = two.upper()
total = one + two
return total
2 Answers
Seth Killian
2,525 PointsYou need the function to be dynamic and work with the length. For instance:
def sillycase(word):
half = int((len(word))/2) # Diving by two will return a float value - Slicing requires an int
first = word[:half].lower()
second = word[half:].upper()
return first+second
Abdulkadir Kollere
1,723 PointsThanks Seth. There is no option to mark the question as answered.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 Pointschanged from comment to answer
Abdulkadir Kollere
You can mark the question as answered now if you want.