Example #1
0
 def editCharacter(self, character: Character):
     choice = input(f'Select Attribute to Edit: {character.__slots__}\n')
     if choice in character.__slots__:
         print(f'{choice}: {character.__getattribute__(choice)}')
         value = input(f'What would you like the new value for {choice} to be?\n')
         print(f'{choice}: {value}')
         confirm = input('Are you sure you would like to save these changes? (Y/N)\n')
         if confirm.upper() == 'Y':
             character.__setattr__(choice, value)
             print(f'{choice}: {character.__getattribute__(choice)}')
             print('Changes Saved')
     move_on = input('Would you like to make additional changes? (Y/N)\n')  # Adding Recursion for addition changes
     if move_on.upper() == 'Y':
         self.editCharacter(character)
     return character