MacSG

LabComPro-Mid_2

Mar 29th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. def cloth_size(lst):
  2.    
  3.     cloth_dict = {'S':0, 'M':0, 'L':0}
  4.     for i in lst:
  5.         if i <= 36:
  6.             cloth_dict['S'] += 1
  7.         elif i <= 44:
  8.             cloth_dict['M'] += 1
  9.         else:
  10.             cloth_dict['L'] += 1
  11.     return cloth_dict
  12.  
  13. #Main Program
  14. print(cloth_size([50,44,40,48]))
  15. print(cloth_size([10,20,30,40,50]))
Advertisement
Add Comment
Please, Sign In to add comment