本代码适用于浙大城市学院TensorFlow课后练习
with open ('RAJ.txt','rt') as text:
text = str(text.read())
text = text.lower()
ls = []
dic = {}
ls2 = []
ls3 = []
def make_ls(text):
temp = ''
global ls
for i in range(0,len(text)):
if 'a' <= text[i] <= 'z':
temp = temp + str(text[i])
else:
if temp != '':
ls.append(temp)
temp = ''
continue
print (ls)
def make_dictionary(ls):
global dic
global ls2
count = 1
ls_temp = []
i = 0
while i < len(ls):
flag = 0
print('b')
for j in range(i + 1,len(ls)):
if ls[i] ==