title: Conditionally increase integer count with an if statement in python
body: <p>I'm trying to increase the count of an integer given that an if statement returns true. However, when this program is ran it always prints 0.I want n to increase to 1 the first time the program is ran. To 2 the second time and so on.</p>
  
  <p>I know functions, classes and modules you can use the global command, to go outside it, but this doesn't work with an if statement. </p>
  
  <pre><code>n = 0
  print(n)
  
  if True:
      n += 1
  </code></pre>