#0701
ch1 = str(input())
ch2 = str(input())
txt_file = open('Pyprog0701.txt','r')
wrd = txt_file.read()
wrd = wrd.lower()
txt_file.close()
m=0
if ch1>ch2:
max=ch1
min=ch2
else:
max=ch2
min=ch1
for i in range(ord(min),ord(max)+1):
for j in wrd:
if i==ord(j):
m=m+1
print('The number of characters between {} and {} in file is {}'.format(ch1,ch2,m))
利用Python统计字母
于 2022-04-28 23:27:06 首次发布