## kiri88

Hi? i'm new at programming and im trying to decipher a code. i'm trying to count how many times a char occurs in txt file

## ihatehippies 11

File = open('path\\to\\file', 'rb')
File.close()

Data.count('aChar')

## kiri88

Thanks.. i got it another way.. i converted the string into ascii values then saved them into a list.
i then used a list.count(i) to see how many times a certain value occurred.. thanks again

## ihatehippies 11

to find the letter that occurs the most you can do:

File = open("path", "rb")
mode = max(txt, key=txt.count)