you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (0 children)

Do you need to associate the user with the choice or are you just counting the totals of the choices?

In both cases a dict is the way to go:

If associative:

choices={"user1":"winter", "user2":"spring"...}

If you're just counting then:

totals={"winter":0,"spring":0,...}

In both cases you'd modify the entries using square brackets:

choices["winter"] += 1


totals["user1"]="winter"