python remove multiple characters from string
import re
print(re.sub("e|l", "", "Hello people"))
"Ho pop"
python remove multiple characters from string
import re
print(re.sub("e|l", "", "Hello people"))
"Ho pop"
remove multiple strings from list python
# Python program to remove multiple
# elements from a list
# creating a list
list1 = [11, 5, 17, 18, 23, 50]
# Iterate each element in list
# and add them in variable total
for ele in list1:
if ele % 2 == 0:
list1.remove(ele)
# printing modified list
print("New list after removing all even numbers: ", list1)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us