We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 902fe1c commit 3a275caCopy full SHA for 3a275ca
strings/remove_duplicate.py
@@ -1,14 +1,15 @@
1
-""" Created by sarathkaul on 14/11/19 """
2
-
3
4
def remove_duplicates(sentence: str) -> str:
5
"""
6
- Reomove duplicates from sentence
+ Remove duplicates from sentence
7
>>> remove_duplicates("Python is great and Java is also great")
8
'Java Python also and great is'
+ >>> remove_duplicates("Python is great and Java is also great")
+ 'Java Python also and great is'
9
10
- return " ".join(sorted(set(sentence.split(" "))))
+ return " ".join(sorted(set(sentence.split())))
11
12
13
if __name__ == "__main__":
14
- print(remove_duplicates("INPUT_SENTENCE"))
+ import doctest
+
15
+ doctest.testmod()
0 commit comments