What I want to do is have Python generate a number between 1 and 6, then add 6 to that number which I have got it to do and provide me with a result, however what I can't seem to figure out is how to make that value able to be called so it can go up and down during the game, here is what I have so far:
import random
import time
Name = input("Before we get started lets get your character created, tell me what is your name?")
print()
print ("Welcome ",Name," to the adventure of a lifetime. The next thing you will need to do is sort out your character stats. This will require dice rolls which we will do within the game.")
print()
def skillroll():
skillroll=""
while skillroll !="Y" and skillroll != "N":
skillroll = input("First we need to roll for your skill, would you like me to roll? Y/N")
if skillroll=="Y":
print("Rolling the dice..")
skill=random.randint(1,6)
time.sleep(2)
print("I rolled a", skill, " I will now add 6 to this so your skill is", skill+6)
skill=skill+6
print()
return skillroll
skillroll()
I just cant see how to get that final answer out so I can use it during the game-play.
A friend of mine sent me this to help https://github.com/protocol7/python-koans/blob/master/python%202/koans/about_classes.py
But I just cant see how this relates and every answer I found on Stackoverflow is for different languages.