title: Check if value is zero or not null in python
body: <p>Often I am checking if a number variable <code>number</code> has a value with <code>if number</code> but sometimes the number could be zero. So I solve this by <code>if number or number == 0</code>.</p>
  
  <p>Can I do this in a smarter way? I think it's a bit ugly to check if value is zero separately.</p>
  
  <h1>Edit</h1>
  
  <p>I think I could just check if the value is a number with</p>
  
  <pre><code>def is_number(s):
      try:
          int(s)
          return True
      except ValueError:
          return False
  </code></pre>
  
  <p>but then I will still need to check with <code>if number and is_number(number)</code>.</p>