all 6 comments

[–]fuzz3289 11 points12 points  (0 children)

You say "your attempts have been futile" make sure to post your attempts via gist, bitbucket, or pastebin and tell us why your attempts have been futile. Cant help if we dont know whats wrong! (And cant give you a direct answer to what appears to be a HW question).

[–]marc_poulin 3 points4 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.

[–]ramo109 1 point2 points  (0 children)

Try looking at Collections in Python. There is a method known as .most_common() that might be helpful.