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