title: Multiple if statements in a lambda function
body: <p>I am trying to use 3 if statements within a python lambda function. Here is my code:</p>
  
  <pre><code>y=lambda symbol: 'X' if symbol==True 'O' if symbol==False else ' '
  </code></pre>
  
  <p>I Have been able to get two if statements to work just fine e.g.</p>
  
  <pre><code>x=lambda cake: "Yum" if cake=="chocolate" else "Yuck"
  </code></pre>
  
  <p>Essentially, I want a lambda function to use if statements to return 'X' if the symbol is True, 'O' if it is false, and ' ' otherwise. I'm not even sure if this is even possible, but I haven't been able to find any information on the internet, so I would really appreciate any help :)</p>