# # 寻找高频单词
# stopword = ['am', 'is', 'are', 'which', 'where', 'when']
# s=['What is deep learning?','Deep learning is a subset of machine learning, which is essentially a neural network with three or more layers.','These neural networks attempt to simulate the behavior of the human brain—albeit far from matching its ability—allowing it to learning from large amounts of data.']
# words=[]
# for sentence in s:
# t=[]
# for i in sentence.split():
# b = i.strip(',|?|.|!')
# if b not in stopword:
# t.append(b)
# words.append(t)
# # print(words)
# word123=words[0]+words[1]+words[2]
# # print(word123)
# max=-1
# for i in word123:
# if word123.count(i)>max:
# max=word123.count(i)
# l=i
# print(l,max)
#教师分配
# import random
# teacher=[0,1,2,3,4,5,6,7]#定义8个教师
# s=[[],[],[]]#定义3个教室
# for i in teacher:#8个教师遍历一遍
# num = random.randint(0, 2)#随机选择一个教室
# s[num].append(i)#放入教师
# print(s)#输出
#字符串转换成元组
# s='232'
# t=tuple(s)
# print(t)
#统计字数个数
# a=(-1,-3,-2,-4,0,0,0,1,2,3,4)
# zheng=0
# fu=0
# ling=0
# for i in range(len(a)):
# if a[i]==0:
# ling+=1
# elif a[i]<0:
# fu+=1
# elif a[i]>0:
# zheng+=1
# print(ling,zheng,fu)
#中文数字对照
a=input()
t=tuple(a)
s=('零','壹','贰','叁','肆','伍','陆','柒','捌','玖')
for i in range(len(t)):
print(s[int(t[i])],end='')
寻找高频单词,教师分配,字符串转换元组,
于 2023-10-09 15:18:30 首次发布