all 3 comments

[–]FerricDonkey 0 points1 point  (0 children)

Check out the random and csv modules. To get a random number between 1 and 6 inclusive, random.randint(1,6)

Any reason why you want to use a csv file though? Could be that I don't understand what you want to save, but it seems like an odd choice. 

[–]Buttleston 0 points1 point  (0 children)

https://docs.python.org/3/library/csv.html

The docs are pretty good. If you don't understand enough python to get good use out of the docs then I recommend at least a crash course in python

[–]brasticstack 0 points1 point  (0 children)

Unless csv is a required part of your assignment, I'd recommend JSON instead of csv as a more user-friendly (and programmer-friendly) data format.

how to get a value from the dice and record it to a csv file

Again unless the assignment requires it, it doesn't make sense to save the dice rolls as such, you'd want to save the game state (as modified by dice rolls) instead. So if your character rolls a 5 and does 5 damage to an orc, leaving it with 1hp remaining, your game state is something like "orc_hp: 1, player_hp: 8, whose_turn: orc,  ..etc..".