title: Forwarding variables between functions
body: <p>I'm trying to do a calculation in the following code:</p>
  
  <pre><code>def traffic_intensity(count):
  """Number of cars passing by"""
  int(count)
  if count &lt; 5000:
      level = "Very Low"
  elif 5000 &lt;= count &lt; 10000:
      level = "Low"
  elif 10000 &lt;= count &lt; 18000:
      level = "Moderate"
  elif count &gt;= 18000:
      level = "High"
  return level
  
  
  def number_of_busy_days(counts):
      """Busy days based on traffic flow"""
      daily_counts = 0
      for count in counts:
          if traffic_intensity(level) == "Moderate" or "High":
              daily_counts = daily_counts + 1
      return daily_counts
  
  counts = [18000, 10000, 500, 9999, 12000]
  print(number_of_busy_days(counts))
  </code></pre>
  
  <p>What I'm trying to achieve is to use the traffic_intensity function to calculate the number of busy days - a busy day is defined as having more than the "Moderate" amount of traffic given in the traffic_intensity function. I've tried a lot of different ways but I'm running out of ideas at this point. </p>
  
  <p>The problem I'm encountering is that it doesn't find the level variable form the first function. I get the following error:</p>
  
  <pre><code>    if traffic_intensity(level) == "Moderate" or "High":
      NameError: name 'level' is not defined
  </code></pre>
  
  <p>Is anyone able to help me? Thanks! ^_^</p>