looking to the get() method some
This commit is contained in:
2
main.py
2
main.py
@@ -3,7 +3,7 @@ import random
|
||||
|
||||
class PlayerCharacter:
|
||||
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.intelligence = attributes.get('intelligence', roll_dice(3,6))
|
||||
self.wisdom = attributes.get('wisdom', roll_dice(3,6))
|
||||
|
||||
Reference in New Issue
Block a user