I am currently reading "Python Programming for the Absolute Beginning 3rd Edition". One of the challenges is:
Write a Character Creator program for a role-playing game. The player should be given a pool of 30 points to spend on four attributes: Strength, Health, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribute and put them back into the pool.
At first I wrote it with the variables
pool = 30
strength = 0
health = 0
wisdom = 0
dexterity = 0
This section is regarding lists and dictionaries. So my question is: Is it better to use the variables in this manner or is it possible to use dictionaries? If so, is it more efficient? ie:
attributes = {
"strength" : 0,
"health" : 0,
"wisdom" : 0,
"dexterity" : 0
}