Answer to Question #325859 in Python for Vasu

Question #325859

Andy has the word W and he wants to print the unique characters in the word in the order of their occurrence.write a program to help Andy print the unique characters as described above.


NOTE : consider lower and upper case letters as different


Input

The input is a single line containing the word W.


Output

The output should be a single line containing space separated characters.


Explanation

In the example, the word is MATHEMATICS

The unique characters in the given word are M, A, T, H, E, I, C, S, in the order of occurrence.so the output should be M A T H E I C S.


Sample Input1

MATHEMATICS

Sample Output1

M A T H E I C S


Sample Input2

banana

Sample Output2

b a n


1
Expert's answer
2022-04-08T06:08:23-0400
sentense = input()
uniq_chars = []
for char in sentense:
	if char not in uniq_chars:
		uniq_chars.append(char)
print(" ".join(uniq_chars))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS