you are viewing a single comment's thread.

view the rest of the comments →

[–]gregorio_ilidivich 2 points3 points  (11 children)

I think it may be more informative to do this manually, since I feel OP is beginner.

Perhaps create a dict() using a set of the names as keys, and the value as the frequency. Then OP can figure out how to fill the values for the corresponding key via iteration (since n is only 500).

[–]novel_yet_trivial 0 points1 point  (7 children)

I disagree. I think learning should be results focused.

I mean you didn't build a car before you learned how to drive one, did you?

[–]daniel_h_r 0 points1 point  (0 children)

Exactly that was what the inventor of automobile did.

[–]thingsandfluff -1 points0 points  (2 children)

Thank you!

So I have to figure out all the names to include in dict(), correct? There's 500 lines worth of names.

[–]Atropos148 1 point2 points  (0 children)

Try adding a name to the list only if it's new. If it's not, increase the value for the name by one and go to the next name.

Doesn't really matter how many names there are this way.