looking to the get() method some

This commit is contained in:
Zachary Watts
2026-04-18 00:54:33 -04:00
parent 215361e4d9
commit 74881a607c

View File

@@ -3,7 +3,7 @@ import random
class PlayerCharacter: class PlayerCharacter:
def __init__(self, attributes={}) -> None: def __init__(self, attributes={}) -> None:
# using a get() method to pull an attribute else use a default value # using a get() method to pull an attribute else use a default value, https://python-academy.org/en/handbook/get
self.strength = attributes.get('strength', roll_dice(3,6)) self.strength = attributes.get('strength', roll_dice(3,6))
self.intelligence = attributes.get('intelligence', roll_dice(3,6)) self.intelligence = attributes.get('intelligence', roll_dice(3,6))
self.wisdom = attributes.get('wisdom', roll_dice(3,6)) self.wisdom = attributes.get('wisdom', roll_dice(3,6))