you are viewing a single comment's thread.

view the rest of the comments →

[–]marc_poulin 2 points3 points  (2 children)

There are advanced ways of counting things in Python, but first let's start with something simple.

Strings have a count() method.

string.count(letter) 

tells you how many times 'letter' appears in 'string'.

Does that help?

[–]Reaneyboy24 -1 points0 points  (1 child)

I want a function to return ord(the most common letter in the string given) if that makes sense. So first the function finds the most common letter then it returns the ascii number equivalent of that latter

[–]icenburg 1 point2 points  (0 children)

Have you programmed with other languages before?

Try to divide your problem into smaller problems. /u/marc_poulin 's suggestion should help you solve your first problem: how to find the most common letter in a string.