标签:str tar int end bsp rip 开头 列表 元素
li = ["alex"," aric","Alex","Tony","rain"]
for i in li:
new_li = i.strip()
if (new_li.startswith(‘a‘) or new_li.startswith(‘A‘)) and new_li.endswith(‘c‘):
print(new_li)
09 查找列表中元素,移除每个元素的空格,并查找以a或A开头并且以c结尾的所有元素
标签:str tar int end bsp rip 开头 列表 元素
原文地址:https://www.cnblogs.com/wssaried/p/9862676.html