title: How do I store a random integer in a local variable in Python?
body: <p>I have some code here for a basic game I'm making in Python 3.x. As you can see, the local variable 'code1' creates a random two digit number between my values, for the first part of my vault's unlock code (later in game). What I want to do is store the random integer somehow so if the specific room is re-visited it will display the first outputted random number from this function and not keep changing as this would defeat the object of clue collecting.</p>
  
  <pre><code>def corridorOptions():
      code1 = random.randint(30,60)
      corridorChoice = input('&gt; ')
      if corridorChoice == "loose":
          delayedPrint("You lift the loose floorboard up out its place." + '\n')
          delayedPrint("It shifts with hardly any resistance." + '\n')
          delayedPrint("There is a number etched. It reads " + "'" + str(code1) + "'")
  </code></pre>
  
  <p>Cheers guys.</p>