I just completed an exercise for this text and was wondering if this could be done more efficiently using the same technologies (dictionaries, if statements etc…) This seems to be inefficient to code.
The challenge is as follows:
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.
One thing you could easily improve is, the first series of ‘if’s:
by using a dictionary
skills_dict = {"1": "Strength", "2": "Health", ... }you can do:Same for the second group of ‘if’s