Commit 26710dc4 by BellCodeEditor

save project

parent dc22b1a3
Showing with 12 additions and 0 deletions
#with open(r"C:\Users\mk\Desktop\book.txt",'w',encoding='utf-8') as file:
# file.write('小兰:12本\n')
# file.write('小丽:11本\n')
# file.write('李文:9本\n')
with open(r"C:\Users\mk\Desktop\book.txt",'r',encoding = 'utf-8') as file:#打开文件
for date in file: #遍历file date为储存数据的量
if '小兰:12本' in date: #判断'小兰:12本'是否date里
print('数据在文件里') #输出
\ No newline at end of file
import turtle
import turtle
\ 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