In this program, we will take a string as input and remove duplicate words from the string.
Steps to solve the program
- Take a string as input.
- Convert the string into a list and create an empty list.
- Use for loop to iterate over every of the list.
- Add every of the list to the empty list, if a word repeats then do not add it to the empty list.
- Convert the new list into a string using join().
- Print the output.
Output :