
arielp
3,000 Pointsdef sillycase
Here I am stuck again unable to pass the challenge.
wrd = ["treehouse"]
def sillycase(word):
for word in word:
print word[:4] + word[-5:].upper()
return
sillycase(wrd)
thanks in advance!
2 Answers

mhjp
20,346 PointsNo need to loop here, you can accomplish this with string slicing.
def sillycase(s):
return s[:len(s)//2].lower() + s[len(s)//2:].upper()

Oleksandr Krasnovskyy
3,312 Pointsgot you, makes sense. Appreciate it
arielp
3,000 Pointsarielp
3,000 PointsI see, thanks.
Oleksandr Krasnovskyy
3,312 PointsOleksandr Krasnovskyy
3,312 Pointswhy is it "//"?
mhjp
20,346 Pointsmhjp
20,346 Points// is the floor division operator. It returns the integral part of the quotient.