CBSE Class 12 Computer Science
Question 81 of 120
Review of Python Basics — Question 33
Back to all questions 33
Question Write a Python program to remove duplicate characters of a given string.
input_string = input("Enter the string: ")
unique_chars = {}
for char in input_string:
if char not in unique_chars:
unique_chars[char] = True
result = ''.join(unique_chars.keys())
print(result)Enter the string: hello world
helo wrd