title: How to accept an answer from two if statements in python
body: <p>I have a question regarding nested if statements in python code. I was wondering if I could have two if statements in a while loop that both have a nested if statement inside. Then the person would be able to either reply from a nested if statement or the other while loop if statement. Any thoughts on my code would be appreciated. </p>
  
  <p>This is a code sample of a game I am trying to make. I am trying to learn and incorporate new skills into it and so here is my question. </p>
  
  <p>Is there a way to make it that when I type "look forward" into the question input and for the second input I say "look backward" instead of "go there" then the input could be for the question input instead of the move_on input?</p>
  
  <pre><code>def first_room():
      print("Your in a room how to get out...")
      next_room = True
      while next_room:
          question = input()
          if question == "look forward".lower():
              print("You are looking forward")
              move_on = input()
              if move_on == 'go there'.lower():
                  next_room = False
                  second_room()
              else:
                  pass
          if question == 'look backward'.lower():
              print("You are looking backward")
              move_on = input()
              if move_on == 'go there'.lower():
                  next_room = False
                  third_room()
              else:
                  pass
  
  
  def second_room():
      print("This is the second room")
  
  
  def third_room():
      print("This is the third room") 
  
  
  first_room()
  </code></pre>