只需使用
startswith
w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]
for word in w:
if word.startswith('A'):
print(word)
>>> Algorithm
>>> Analyze
>>> Algorithm
编辑:因为你不能使用
开始使用
for word in w:
if word[0] == 'A':
print(word)