We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd81ef6 commit fbca300Copy full SHA for fbca300
q10.py
@@ -0,0 +1,15 @@
1
+# Write a program that accepts a sequence of whitespace separated words as
2
+# input and prints the words after removing all duplicate words and sorting
3
+# them alphanumerically.
4
+# Suppose the following input is supplied to the program:
5
+# hello world and practice makes perfect and hello world again
6
+# Then, the output should be:
7
+# again and hello makes perfect practice world
8
+
9
+rawInp = (input("Enter Input: "))
10
+newList = [n for n in rawInp.split(' ')]
11
+tempList = []
12
+[tempList.append(i) for i in newList if i not in tempList]
13
+tempList.sort()
14
+print(' '.join(tempList))
15
0 commit comments