def remove_ignore_char(word):
ignore_char = ['A', 'B', 'C',
]
for char in ignore_char:
if char in word:
word = word.replace(char, '')
return word
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
python 2 则去掉第一行
或
此法最简洁了吧~
python3