开发者

I need to find how much a combinations of letters are repeated in a txt file with random 200 letters and put them in a list

So i have to create a list that determines the amount of certain letters appear in a combination said above. For example letters from A to E repeats 57 times. How would i code this in python?Picture of the question

plzz help! and thank you

ive tried this already


# Input section
print("(1)  Find the number of lines in a file.")
fin = open("inputFileAssig.txt", "r")
numLines = len(fin.readlines())
fin.close()

# Processing section
fin = open("inputFileAssig.txt&qu开发者_如何学Goot;, "r")
lstData = []
for index in range(0, numLines):
    line = fin.readline()
    line = line.replace("\n", "")
    lstData.append(line)
print(lstData)             # delete later
fin.close()

# Output section

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜