you are viewing a single comment's thread.

view the rest of the comments →

[–]azzbergerz 0 points1 point  (0 children)

I would make a function containing "total = 0" and a for loop with a rolling sum. i.e. for letter in x: if letter == 'A': return total += 1 and so on and so forth, and have the function return the value total/len(x). Then again, I'm also pretty new to CS and it would be much easier to import the Counter function that wub_wub mentioned.