title: How do I import a list from a function in an imported file?
body: <p>I am attempting to create an RPG game and I am making the code more concise. I have come across a problem that I can't resolve, and I have also done some research on it, but I can't seem to fix it. </p>
  
  <p>I have my main code as <code>DragonFightingRPG.py</code> with my other files that I am importing in the same directory (<code>prints.py</code> and <code>options.py</code>).
  I am trying to import a list from another file, so it can check whether the user has inputted one of those answers, and it can answer accordingly.</p>
  
  <p><strong>DragonFightingRPG.py</strong></p>
  
  <pre><code>import prints
  import options
  
  class Player(object):
      def __init__(self):
          self.name = None
          self.gold = None
          self.maxhealth = 100
          self.health = 100
  
      def get_name(self):
          self.name = input("Hey there! What's your name?\n~~&gt; ")
          print("Nice name, {0}!".format(self.name))
  
      def give_gold(self):
          print("Since you are new around here, 100 gold doubloons have been given to you!")
          self.gold = 100
  
      def gold_counter(self):
          print("You currently have {0} gold!".format(player.gold))
  
  
  
  player = Player()
  
  
  def start():
      player.get_name()
      player.give_gold()
      gold_counter()
      prints.intro()
  
  
  def gold_counter():
      while True:
          option = input("Do you want to see your balance?\n~~&gt; ").upper()
          if option in {options.yes_opt}:
              print("You currently have {0} gold.".format(player.gold))
          elif option in {options.no_opt}:
              print("You can check your balance later in the game.")
          else:
              print("Please try again.")
              continue
          break
  
  
  
  
  
  start()
  </code></pre>
  
  <p><strong>prints.py</strong></p>
  
  <pre><code>class Player(object):
      def __init__(self):
          self.name = None
          self.gold = None
          self.maxhealth = 100
          self.health = 100
  
      def get_name(self):
          self.name = input("Hey there! What's your name?\n~~&gt; ")
          print("Nice name, {0}!".format(self.name))
  
      def give_gold(self):
          print("Since you are new around here, 100 gold doubloons have been given to you!")
          self.gold = 100
  
      def gold_counter(self):
          print("You currently have {0} gold!".format(player.gold))
  
  def intro():
      print("Narrator: Uhhhm...")
      print("N: Let me check my list...")
      print("N: Ah! Yes! {0}, that's right. I heard you were supposed to be arriving today.".format(player.name))
      print("N: Welcome to... THE DRAGON FIGHTER GAME!")
      print("N: I know, it isn't the most imaginative name.")
      print("N: Don't look at me like that, I tried my hardest!")
      print("N: Anywho, let's carry on.")
      print("N: For some stupid reason, the creator of this game didn't give me an actual name, so\nmy name is just \"Narrator\" or \"N\".")
      print("N:")
  
  player = Player()
  </code></pre>
  
  <p><strong>options.py</strong></p>
  
  <pre><code>def yes_opt():
      {"Y", "YE", "YES", "YEAH", "PLEASE", "YES PLEASE"}
  
  def no_opt():
      {"N", "NO", "NOPE"}
  </code></pre>
  
  <p>The part I am struggling with is <code>elif option in {options.no_opt}:</code> and <code>if option in {options.yes_opt}:</code>. It works if I just have the list typed out in the main code, but I want to try and get it imported from the other file. Any thoughts?</p>