+ 1
What mistake am I doing?
Reverse word if word length is odd else print the same word https://code.sololearn.com/c9az5I6BGROQ/?ref=app
3 Answers
+ 4
return [' '.join(i) if len(i)%2==0 else i[::-1] for i in word.split()]
the most outer brackets đ
+ 3
btw
return [i if len(i)%2==0 else i[::-1] for i in word.split()]
is shorter