Here’s how you can implement the algorithm to reverse each word of a string in Python:pythonCopy code# Python program to reverse each word of a string # Function to reverse each word in the stringdef reverse word(s): # Split the string into words words = split(” “) # Reverse each word and store in a new list reversed_words = [word[::-1] for word in words] # Join the reversed words back into a string reversed_string = ” “.join(reversed_words) return reversed_string # Main functionif __name__ == “__main__”: # Taking input from the user user_input = input(“Enter the string: “) # Calling the function to reverse each word print(reverse_word(user_input)) 