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

slices

Quiz Challenge: Create a function named sillycase and it'll take a single string as an argument. sillycase should return the same string but the first half should be lowercased and the second half should be uppercased. For example, with the string "Treehouse", sillycase would return "treeHOUSE". Don't worry about rounding your halves, but remember that indexes should be integers. You'll want to use the int() function or integer division, //.

sillycase.py
def sillycase(cola):
    start = cola[:int(len(cola)/2)]
    end = cola[int(len(cola)/2):]
    small = start.lower()
    big = end.upper()
    final = small + big
    return final

2 Answers

here try this

[Moderator redacted]
Michael Hulet
Michael Hulet
47,913 Points

Hey Christopher!

For future reference, it's frowned upon in the Community to post code that can be copied and pasted and just work without explanation. As such, I've redacted the code in this answer. If you'd like to re-post your code, feel free to do so, but make sure it illustrates how to solve the problem without actually being copy/pastable to solve it. Also, be sure to include a good explanation about how and why it's the correct solution to the problem. Thanks for helping out in the Community!

Christopher thank you so much for your help and hints. I understood what mistakes I made and your help got me through. I read your response before it was redacted by the last post. Cheers.

@Idris Abdulwahab glade to help that's what the community is for