Write a function to reverse every word in a string


Topic: Write a function to reverse every word in a string

Solution

def reverse_word(sen: str):
    words = sen.split(' ')
    rever_word = [ i[::-1] for i in words ]
    final_sen = ' '.join(rever_word)
    print(final_sen)



List all Python Programs