title: How do I iterate through a list of tuples?
body: <p>I am having some doubts with this homework on python. The exercise consists on the following:</p>
  
  <blockquote>
    <p>This bus has a passenger entry and exit control system to monitor the number of occupants it carries and thus detect when there is too high a capacity.</p>
    
    <p>At each stop the entry and exit of passengers is represented by a tuple consisting of two integer numbers.</p>
  
  <pre><code>bus_stop = (in, out)
  </code></pre>
    
    <p>The succession of stops is represented by a list of these tuples.</p>
  
  <pre><code>stops = [(in1, out1), (in2, out2), (in3, out3), (in4, out4)]
  </code></pre>
    
    <p>Goals:</p>
    
    <ul>
    <li>Use lists, tuples</li>
    <li>Use while/for loops</li>
    <li>Use minimum, maximum, length</li>
    <li>Use average, standard deviation</li>
    </ul>
    
    <p>Tasks:</p>
    
    <ul>
    <li>Calculate the number of stops.</li>
    <li>Assign to a variable a list whose elements are the number of passengers at each stop (in-out),</li>
    <li>Find the maximum occupation of the bus.</li>
    </ul>
  </blockquote>
  
  <p>So far I've come up with this code but it's not returning anything, so, definitely I am doing something wrong due to my inexperience with python.</p>
  
  <pre><code>bus_is_full = False
  bus_capacity = 0
  stops = [(20, 0), (13, 7), (40, 10), (1, 20)]
  while not bus_is_full == True:
      for stop in stops:
          bus_capacity = stops()
          if bus_capacity == 50:
              bus_is_full = True
              stops +=1 
          elif bus_capacity &lt; 50:
              stops +=1
      print(bus_capacity)
  </code></pre>