Commit cb2e17cf by BellCodeEditor

save project

parent ec261f44
Showing with 4 additions and 8 deletions
...@@ -7,12 +7,7 @@ with open(r"C:\Users\玛酷机器人\Desktop\test.txt",'r',encoding='utf-8') as ...@@ -7,12 +7,7 @@ with open(r"C:\Users\玛酷机器人\Desktop\test.txt",'r',encoding='utf-8') as
#q.write('小强:12本\n') #q.write('小强:12本\n')
#q.write('李明:15本\n') #q.write('李明:15本\n')
for a in q: for a in q:
if '小强:10本' in a: if "许群基:10本" in q:
print('小强的数据在文件中') print("数据在文件中")
else: else:
print('小强的数据不在文件中') print("数据不在文件中")
if '小兰:12本' in a: \ No newline at end of file
print('小兰的数据在文件中')
else:
print('小兰的数据不在文件中')
break
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment