title: Twilio's Python WhatsApp API doesn't work with conditional flow statements based on responses
body: <p>I'm experimenting with Twilio's WhatsApp API with Python but the conditional flow doesn't work. When I enter the word 'office' after getting the response 'What would you like to print?', I don't get the expected response 'Opening...'. I'd require some help regarding this.</p>
  <pre><code>from twilio.rest import Client
  from flask import Flask, request, redirect
  from twilio.twiml.messaging_response import MessagingResponse
  
  app = Flask(__name__)
  @app.route(&quot;/&quot;, methods=['GET', 'POST'])
  def wa_print():
      &quot;&quot;&quot;Respond to incoming messages with a simple text message.&quot;&quot;&quot;
      question = request.values.get('Body')
      print(question)
      # Start our TwiML response
      resp = MessagingResponse()
      if (question == 'print'):
          resp.message('What would you like to print?')
          doc = request.values.get('Body')
  
          if (doc == 'office'):
              resp.message('Opening...')
  
      return str(resp)
  
  
  if __name__ == &quot;__main__&quot;:
      app.run()
  </code></pre>