#背单词系统
用文件系统和面向对象的方式
class danci():
def new_del(self,a):#删除
sying = a
flag = False
with open('danciben.txt','r') as f1:
lines = f1.readlines()
with open('danciben.txt','w+') as f2:
for line in lines:
k =line.split('-')[0]
if sying == k:
flag = True
continue
f2.write(line)
if flag == True:
print('删除成功!')
if flag == False:
print("未有该单词")
def new_add(self,y,c):#添加
ying = y
chong = c
liu = y + '-' + c + '\n'
flag = True
with open('danciben.txt','r') as f:
line = f.readlines()
for index in line:
h = index.