title: replacing string integer in list, python
body: <p>I wanted to replace string with an integer so I first tried this</p>
  <pre><code>timeupseats=[0,480,480,0]
  for n in range(0,4): 
     if timeupseats[n]==0:
         timeupseats[n]='CLOSED'
  for n in range(0,4): 
     if timeupseats[n]=='CLOSED':
         timeupseats[n]==0
  </code></pre>
  <p>Because the first code didn't work, I tried this code for the second time and it worked</p>
  <pre><code>timeupseats=[0,480,480,0]
  for n in range(0,4): #print closed when there is no ticket left
      if timeupseats[n]==0:
          timeupseats[n]='CLOSED'
  timeupseats = [0 if i=='CLOSED' else i for i in timeupseats]
  </code></pre>
  <p>What's the difference between the first code and the second code?
  Why did only the second code work?</p>