Backward Each Word

Backward Each Word

In a given string you should reverse every word, but the words should stay in their places.

example

Input: A string (str).

Output: A string (str).

Examples:

assert backward_string_by_word("") == ""
assert backward_string_by_word("world") == "dlrow"
assert backward_string_by_word("hello world") == "olleh dlrow"
assert backward_string_by_word("hello   world") == "olleh   dlrow"

Precondition: The line consists only from alphabetical symbols and spaces.

40