title: How to implement a counter using a lambda?
body: <p>Can I implement a counter using a <code>lambda</code> function in python or some expression more pythonic?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>counter = 0     
  if 0 &lt; arrival_time:
     counter += 1
  else:
     pass
  </code></pre>
  
  <p>this is what I tried:</p>
  
  <pre><code>count_late = lambda x, arrival_time: x+=1 if 0 &lt; arrival_time else pass
  counter_late(counter, arrival_time)
  </code></pre>
  
  <p>The error:
  <a href="https://i.stack.imgur.com/W61Go.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W61Go.jpg" alt="enter image description here"></a></p>
  
  <p>What am I missing or how can I improve this code?</p>