Skip to content

Commit fbca300

Browse files
committed
q10
1 parent bd81ef6 commit fbca300

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

q10.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)