擅长:python、mysql、java
<p>我找到了解决办法:</p>
<pre><code># -*- coding: utf-8 -*-
with open(r"C:\Users\Valentin\Desktop\list.txt") as f:
content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]
#print(content)
result = [i for i in content if i.startswith('c')]
result2 = [i for i in result if i.endswith('e')]
result3 = [i for i in result2 if len(i)==9]
print(result3)
</code></pre>