Advertisement
Guest User

main script

a guest
Sep 20th, 2017
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import Population_Data   # A module we wrote
  2.  
  3. # The first year in the population data
  4. YEAR_1 = 1950
  5.  
  6. # Open the file
  7. file_obj = open('USPopulation.txt', 'r')
  8.  
  9. # This statement creates a list with all the lines in the file where the
  10. # entries are strings.
  11. population_list = file_obj.read().splitlines()
  12. # So we convert the strings to integers, one-by-one.
  13. for i in range(len(population_list)):
  14.     population_list[i] = int(population_list[i])
  15.  
  16. Population_Data.display_population_data(population_list, YEAR_1)
  17.      
  18. # Close the file
  19. file_obj.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement