fork download
  1. score_list=[65,92,78,90,45,83,57.96]
  2. score_dict={'high':[],'middle':[],'low':[]}
  3. for score in score_list:
  4. if score>=90:
  5. score_dict['high'].append(score)
  6. elif score>=60:
  7. score_dict['middle'].append(score)
  8. else:
  9. score_dict['low'].append(score)
  10. print(score_dict)
Success #stdin #stdout 0.09s 14176KB
stdin
Standard input is empty
stdout
{'high': [92, 90], 'middle': [65, 78, 83], 'low': [45, 57.96]}