Blog Archive

search

Tuesday, August 6, 2019

Python program to strip a set of characters from a string


a = input(' enter an string : ')
b = input('enter charecters to strip : ')
c=''
d=a
for i in b:
    c=''
    for j in range(len(d)):
        if(i != d[j]):
            c = c+d[j]
    d=c   
print(c)
   

No comments:

Post a Comment

Python program to create a string from two given strings concatenating uncommon characters of the said strings

PROGRAM :  a = input('Enter a string : ') b = input('Enter a string : ') c='' for i in a:     if(i not in b):...