Computer Science
Write a Python program to remove duplicate characters of a given string.
Python
Python String Manipulation
2 Likes
Answer
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)
Output
Enter the string: hello world
helo wrd
Answered By
1 Like
Related Questions
Write a Python program to input names of 'n' customers and their details like items bought, cost and phone number, etc., store them in a dictionary and display all the details in a tabular form.
Write a Python program to capitalize first and last letters of each word of a given string.
Write a Python program to compute sum of digits of a given number.
Write a Python program to find the second most repeated word in a given string.