input is: This is An Example
Output: This An Exmpl
li = input("Enter your Sting")
res = ''
for ch in li:
if ch not in res :
res = res + ch
print(res, end=' ')
input is: This is An Example
Output: This An Exmpl
li = input("Enter your Sting")
res = ''
for ch in li:
if ch not in res :
res = res + ch
print(res, end=' ')
li = input("Enter your string")
res = ''
for ch in li.lower():
if ch not in res:
res = res + ch
print(res.title(), end='')
I am sure there will be a more elegant way to do this but for now here is a working version which you could refactor or reduce if needed
user_input = input("sentance: ")
seen = set()
filtered_words = []
for word in user_input.split():
filtered_word = ""
for char in word:
if char.lower() in seen:
continue
filtered_word += char
seen.add(char.lower())
if filtered_word != "":
filtered_words.append(filtered_word)
print(*filtered_words)