Write a program which takes two inputs one is a string and other is a character. The function should create a new string after deleting all occurrences of the character from the string and return the new string?
Answers
Answered by
1
del_char = lambda string, char: "".join([c for c in string if c != char])
string, char = input("string: "), input("char: ")
print(del_char(string, char))
Similar questions