0
Is there other way to solve this problem?
Extended version of Code Coach: Extra-Terrestrials https://code.sololearn.com/c8r4dhNYWZ0d/?ref=app
1 Answer
+ 1
sentence = input()
sen_rep = sentence.replace(',',' ')
sen_spl = sen_rep.split()
for word in sen_spl:
print(word[::-1],end=" ")
Using list comprehension
[print(i[::-1],end=" ") for i in input().replace(',',' ').split()]