Commit 0704ccbd by BellCodeEditor

save project

parent 71bf7848
Showing with 5 additions and 7 deletions
with open(r'C:\Users\Administrator\Desktop\book.txt','r',encoding='GBK') as file1:
for data in file1:
if '小强:10本' in data:
print('a在文件中')
if '小兰:12本' in data:
print('b在文件中')
\ No newline at end of file
with open(r'C:\Users\Administrator\Desktop\sales_list.txt','r',encoding='GBK') as file1:
a=file1.readlines()
for i in a:
print(i)
\ 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