title: How can I map two lists into a dictionary from lists being passed into function
body: <p>I am trying to map two list into a dictionary. I know how to do this but I am having a problem when the lists are being passed from functions, only the first values from each list get mapped. i have tried every method of mapping: </p>
  
  <pre><code>def main():
      pop = [34372,37821,45673,67100,69100,70245]
      years = ['2012','2013','2014','2016','2017','2018']
      highest_year_change(years,pop)
  
  def highest_year_change(years,pop):
  
      year_pop_dict = {}
  
      year_pop_tuples = zip(years,pop)
      for key, value in year_pop_tuples:
          year_pop_dict[key] = value
  
      print(year_pop_dict)
  </code></pre>
  
  <p>output:
      {'2012': 34372}</p>
  
  <p>I first tried: <code>year_pop_dict = dict(zip(years,pop))</code>
  but the same results . only when the lists were not passed between functions was the dictionary created as intended.
  `</p>