SHARE
TWEET

Untitled

a guest May 24th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #20130381 최수빈
  2. def population_density(l):
  3.     p=l[0]/l[1]
  4.     if p>=1000 :
  5.         print('%s is very densely populated')
  6.     elif p>=500 :
  7.        print('%s is densely populated')
  8.     elif p>=300 :
  9.         print('%s is normally populated')
  10.     elif p>=100 :
  11.         print('%s is sparsely populated')
  12.     elif p>=300:
  13.         print('%s is very sparsely populated')
  14.  
  15.  
  16.  
  17. #main    
  18. f=open('population.txt')
  19. country={}
  20. for line in f:
  21.     items = line.split()
  22.     key, values = items[0], items[1:]
  23.     country[key]=values
  24.  
  25. for values in country.items():
  26.     population_density(values)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top