jeudi 27 février 2020

Randomize value of given key of Dictionary in Python

So I am practicing python and I'm using a tutorial where you create a terminal based game using python. I'm trying to not follow it letter for letter so I can learn it better. In it I have 2 dictionaries, one for the 'Monster' and 'Player'

 player = {'name': 'Kevin', 'attack': 10, 'heal': 16, 'health': 100}
 monster = {'name': 'Grog', 'attack': 12, 'health': 100}

I want to randomize the 'attack' damage between a set number, how would I implement that?




Aucun commentaire:

Enregistrer un commentaire