Commit 4183e416 by BellCodeEditor

save project

parent 41098908
Showing with 6 additions and 5 deletions
...@@ -5,18 +5,19 @@ def rea(): ...@@ -5,18 +5,19 @@ def rea():
print(a) print(a)
def look(): def look():
with open(r'C:\Users\Administrator\Desktop\text.txt','r',encoding='utf-8') as file: with open(r'C:\Users\Administrator\Desktop\text.txt','r',encoding='utf-8') as file:
if '小强:12本' in file: for date in file:
print("yes") if '小强:12本' in date:
else: print("yes")
print("no")
with open(r'C:\Users\Administrator\Desktop\text.txt','a',encoding='utf-8') as file: with open(r'C:\Users\Administrator\Desktop\text.txt','a',encoding='utf-8') as file:
while True: while True:
i = input("请输入!") i = input("请输入!")
if i == 'q': if i == 'q':
break break
else: if i != 'q' and i != 'r' and i != 'l':
file.write(i + '\n') file.write(i + '\n')
if i == 'r': if i == 'r':
rea() rea()
if i == "l":
look()
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