Here is the problem:
a function that takes two strings and removes from the first string any character that appears in the second string. eg. if the first string is “IamLearningPython” and the second string is “aeiou” the result is “mLrnngPythn”.
I've written the code for this, but I can not figure out the error:
Can any one tell me what is the error with this code:
def attenuate(sequence1, sequence2):
newSeq = []
n = len(sequence2)
for m in range(len(sequence1)):
print(m)
while(n in range(len(sequence2)) and sequence1[m] != sequence2[n]):
'''checks for the condn of matched string if no match found then append the string to the list newSeq '''
if n == len(sequence2):
entry = sequence1[m]
newSeq.append(entry)
n =+1
return newSeq
def main():
return 0
if __name__ == '__main__':
inp1 = str(input('please give your input: '))
'''IamLearningPython'''
seq1 = list(inp1)
inp2 = str(input('please give next input: '))
'''aeiou'''
seq2 = list(inp2)
newSeq1 = attenuate(seq1,seq2)
print(newSeq1)
main()