帮我用python语言编程:1.查找元组中以a或A开头并且以c 结尾的所有元素。 tu = ("alec", " Aric", "Alex", "Tony", "rain")
时间: 2023-10-23 16:09:25 浏览: 86
tu = ("alec", "Aric", "Alex", "Tony", "rain")
for element in tu:
if (element.startswith('a') or element.startswith('A')) and element.endswith('c'):
print(element)
阅读全文