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

Jason Lucero
Jason Lucero
6,969 Points

Sillycase method works in my terminal but not accepted

I am stuck on the sillycase question right now and when I run this through

  def sillycase(string):
      length = len(string)
      half = int(length) / 2
      sillycase = string[0:int(half)] + string[int(half):int(length)].upper()
      return sillycase

1 Answer

andren
andren
28,558 Points

Your method uppercases the second half of the word, but it does not lowercase the first half of the word.

If the input for the method is Treehouse your method would produce TreeHOUSE instead of treeHOUSE like it is supposed to.

If you fix that issue then your code will be accepted.

Jason Lucero
Jason Lucero
6,969 Points

LOL I caught this right before I came back to check the answer typical for me to miss using lower() on the first half of the string. Thanks!