SHARE
TWEET

Untitled

a guest Oct 21st, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import json
  2.  
  3. ref = {1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'June', 7: 'July', 8: 'Aug', 9: 'Sept', 10: 'Oct', 11: 'Nov', 12: 'Dec'}
  4.  
  5. birthdays = json.load(open('birthdays.json'))
  6. months_dict = {}
  7.  
  8. for date in birthdays.values():
  9.     items = date.split('/')
  10.     month_n = int(items[1])
  11.     name= ref[month_n]
  12.     if name in months_dict.keys():
  13.         months_dict[name] = months_dict[name] + 1
  14.     else:
  15.         months_dict[name] = 1
  16. print(months_dict)
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