我如何检查列表中是否有某些内容? 这是我目前的代码:
for line not in line: open("drivers_details.txt"):
if reg not in line:
name=input("what is your name?\n")
address=input("what is your address\n")
print (reg,name,address,"%0.2f"%average_time,"MPH")
(我尝试使用"不在"但它没有工作)
答案 0 :(得分:0)
我想你想要:
for line in open("drivers_details.txt"):
if reg not in line:
etc.