What I'd like to do is have a list of strings be used as attributes of an object when it is created. I've seen another topic discuss using a list of strings as variables by creating a dictionary, but this seems to keep the strings as strings, which won't work for me, I don't think. Here's what I would like to work. It's a DnD exercise:
abilities = ['strength', 'dexterity', 'constitution', 'intelligence', 'wisdom', 'charisma']
class Character:
def __init__(self):
for ability in abilities:
self.ability = roll_ability() #this is a call to an outside function
Thanks!