Reversing each word

Write code · Basic · §3.3 Working with strings

Complete the function solution, which returns sentence with the characters of each word in reverse order.

Keep the words in their original order. Words are separated by a single space.

Function

solution(sentence)

Constraints

Examples

sentenceresult
'hello world''olleh dlrow'
'python practice''nohtyp ecitcarp'

Starter code

def solution(sentence):
    answer = ""
    return answer

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.