Write function remove_duplicate_words(sentence) which takes an input parameter sentence (type string), and returns a string that has
Fantastic news! We've Found the answer you've been seeking!
Question:
Write function remove_duplicate_words(sentence) which takes an input parameter sentence (type string), and returns a string that has all duplicated words removed from sentence.
The words in the returned string should be sorted in alphabetical order.
For example:
Test | Result |
---|---|
simple_sentence = remove_duplicate_words("hello hello hello hello hello") print(simple_sentence) | hello |
simple_sentence = remove_duplicate_words("hello hello hi hi hello hi hello hi hi bye") print(simple_sentence) | bye hello hi |
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date: