Python Program to Remove all duplicates from a given string
str = input ("Enter string")
len1= len(str)
x=''
for i in range (len1):
ch = str[i]
if (str.count(ch)==1):
x+=ch
print('String after removal of duplicates: ',x)
str = input ("Enter string")
len1= len(str)
x=''
for i in range (len1):
ch = str[i]
if (str.count(ch)==1):
x+=ch
print('String after removal of duplicates: ',x)
Comments
Post a Comment