Commit 18015c05 by BellCodeEditor

save project

parent 6d2a6a1c
Showing with 6 additions and 6 deletions
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#a.write('李明,15本\n') #a.write('李明,15本\n')
with open(r"C:\Users\EDZ\Desktop\pyt\123.txt",'r',encoding='utf-8')as a: with open(r"C:\Users\EDZ\Desktop\pyt\123.txt",'r',encoding='utf-8')as a:
b=a.read() b=a.read()
for data in b: #for data in b:
if '小强,10本' in b: if '小强,10本' in b:
print('数据1在') print('数据1在')
if '小兰,12本' in b: if '小兰,12本' in b:
print('数据2在') print('数据2在')
\ No newline at end of file \ No newline at end of file
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