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 trialMUZ140934 Noel Zipingani
2,656 PointsCreate a function named stringcases that takes a string and returns a tuple of four versions of the string: uppercased
need help l cant complete this code challenge
# Handy functions:
# .upper() - uppercases a string
# .lower() - lowercases a string
# .title() - titlecases a string
# There is no function to reverse a string.
# Maybe you can do it with a slice?
def stringcases (my_strings):
return(my_string.upper(),my_string.lower(),my_string.title,my_string[: :-1])
2 Answers
MUZ140889 Dephine Chenayi Chihota
6,766 Pointshie Noel, you are very close but we need to clean up your code a bit. First correct how you defined your function there, you don't need the space between the function name and the argument. Secondly remove the parenthesis around the thing you are returning, brackets are not needed there but include space between the word return and the things you are returning. Thirdly, you forgot to put parenthesis after your title.
This should do the work
def stringcases(my_strings):
return my_string.upper(),my_string.lower(),my_string.title(),my_string[: :-1]
MUZ140934 Noel Zipingani
2,656 PointsTHANKS DEPHINE GOT IT