title: Why won't my project work when oriented a specific way
body: <p>This is a random username generator. The problem is with the themes list. themes is clearly defined <code>themes = [&quot;Possum&quot;, &quot;Pirate&quot;, &quot;Plant&quot;]</code></p>
  <p><code>if request.lower() not in themes:</code>
  If this line of code and its subsequent nested lines are above this line:</p>
  <p><code>if request.lower() == (&quot;possum&quot;):</code></p>
  <p>The terminal reads:</p>
  <pre><code>name's name generator v1
  
  Enter a theme: **pirate**
  
  **That is not a supported theme in this version**
  
  Would you like a list of currently supported themes? yes
  
  ['Possum', 'Pirate', 'Plant']
  
  Enter a theme: **plant**
  
  **That is not a supported theme in this version**
  
  Would you like a list of currently supported themes?
  </code></pre>
  <p>It's looping, but this doesn't really make sense to me because if I place:</p>
  <p><code>if request.lower() not in [&quot;possum&quot;, &quot;pirate&quot;, &quot;plant&quot;]:</code> instead of
  <code>if request.lower() not in themes:</code></p>
  <p>Writing the list out. It works perfectly when sequenced :</p>
  <pre><code> request = input(&quot;Enter a theme: &quot;)
  
      if request == &quot;q&quot;:
          quit()
      if request.lower() not in [&quot;possum&quot;, &quot;pirate&quot;, &quot;plant&quot;]:
            blah blah blah
      if request.lower() == (&quot;possum&quot;):
          blah blah blah
  </code></pre>
  <p>Here is the completed working code. I changed it to an <code>elif</code> and moved it to the bottom of my script.</p>
  <pre><code>import random
  
  usernameposs = [&quot;possum&quot;, &quot;poss&quot;,&quot;oposs&quot;, &quot;opossum&quot;] 
  usernamepirate = [&quot;pirate&quot;, &quot;cap'n&quot;, &quot;deckhand&quot;, &quot;floor-swabber&quot;]
  usernameplant = [&quot;plant&quot;, &quot;shroom&quot;, &quot;succulent&quot;, &quot;garden&quot;]
  
  surname = [&quot;man&quot;, &quot;guy&quot;, &quot;lord&quot;, &quot;vanheel&quot;, &quot;fungicide&quot;, &quot;beard&quot;, ]
  
  themes = [&quot;Possum&quot;, &quot;Pirate&quot;, &quot;Plant&quot;]
  
  
  print(&quot;name's name generator v1&quot;)
  
  while True:
      random_number = random.randint(0, 3) #number of firstnames
      random_number2 = random.randint(0,5) #number of surnames
      request = input(&quot;Enter a theme: &quot;)
      if request == &quot;q&quot;:
          quit()         
      if request.lower() == (&quot;possum&quot;):
          print(usernameposs[random_number], surname[random_number2])
          request = input(&quot;Would you like to generate another username? &quot;)
          if request.lower() == &quot;yes&quot;:
              continue 
          else:
              quit()
      elif request.lower() == (&quot;pirate&quot;):
          print(usernamepirate[random_number], surname[random_number2])
          request = input(&quot;Would you like to generate another username? &quot;)
          if request.lower() == &quot;yes&quot;:
              continue
          else:
              quit()
      elif request.lower() == (&quot;plant&quot;):
          print(usernameplant[random_number], surname[random_number2])
          request = input(&quot;Would you like to generate another username? &quot;)
          if request.lower() == &quot;yes&quot;:
              continue
  
      elif request.lower() not in themes:
          print(&quot;That is not a supported theme in this version&quot; )
          supp_theme = input(&quot;Would you like a list of currently supported themes? &quot;)
          if supp_theme.lower() == &quot;yes&quot;:
              print(themes)
              continue
          elif supp_theme.lower() == &quot;no&quot;:
              print(&quot;Okay, you can enter q to quit&quot;)
              continue 
          elif supp_theme.lower() == &quot;q&quot;:
              quit()
          else:
              print(&quot;stop trying to break it!:)&quot;)
      else:
          quit()
          
  </code></pre>
  <p>Why does it work with when I type the list out, but not when I call the defined above <code>themes</code>? And why does calling <code>themes</code> work when I place the whole if statement as an elif at the bottom of the script?</p>