我有一个包含以下数据的文本文件。我必须提取所有包含签名的行
The document was signed on July 12
The document was signed by Charlie
This document was assigned to John
The document was preassigned to Amanda
预期输出:
The document was signed on July 12
The document was signed by Charlie
如果我正在使用:
for line in file:
if "signed" in line:
print (line)
正在打印所有行
答案 0 :(得分:0)