acbart

Untitled

Dec 13th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. def cig_age_over_days(period):
  2.     cigagenone, cigagefew, cigagemid, cigagemany = [0,0,0,0]
  3.     for item in drug_data:
  4.         if item['CIGAFU'].startswith(age):
  5.             total += 1
  6.             if item['CIGMDAYS'].startswith('Non'):
  7.                 none += 1
  8.             if item['CIGMDAYS'].startswith("1") or item['CIGMDAYS'].startswith("3-"):            
  9.                 few += 1
  10.             if item['CIGMDAYS'].startswith("6"):
  11.                 mid += 1
  12.             if item['CIGMDAYS'].startswith("20") or item['CIGMDAYS'].startswith("30"):
  13.                 many += 1
  14.     return none, few, mid, many, total
Advertisement
Add Comment
Please, Sign In to add comment