title: How do I Assign a random number to a variable?
body: <p>Before I say anything else, I would like to mention that I am almost completely new to coding,  and only have a very rudimentary understanding of python. </p>
  
  <p>Now that that's out of the way, my problem is that I am (attempting) to code a text adventure game, along the lines of D&amp;D. I'm stuck at an early stage- namely, how to assign a random integer between 1 and 18 to a variable. </p>
  
  <p>I've seen some ways of doing this, but the value of the variable changes each time it's called up. This can't happen. The reason for this is because I want the stats (Strength, Wisdom, Intelligence, Dexterity, Charisma, and Constitution) to be a randomly generated but fixed number, that can be called upon and have it the same each time. </p>
  
  <p>I've tried mucking around with things like <code>Str = random.randomint(1,18)</code>, using the random module.</p>
  
  <p>The closest I've come is using the lambda function, so that when I call up the variable it generates a random number which is different each time. None of these have rally worked, and I would really like to know what I'm doing wrong.</p>