Ardianta_Pargo

Menentukan hasil penjualan tertinggi

Oct 18th, 2014
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. >>> bulan = {'jan': 32, 'feb': 43, 'mar': 21}
  2. >>> tmp = max(bulan['jan'], bulan['feb'], bulan['mar'])
  3. >>> tmp
  4. 43
  5. >>> for i in bulan:
  6. ...   print i
  7. ...
  8. jan
  9. mar
  10. feb
  11. >>> for i in bulan:
  12. ...   print bulan[i]
  13. ...
  14. 32
  15. 21
  16. 43
  17. >>> for i in bulan:
  18. ...   if tmp == bulan[i]:
  19. ...     print i
  20. ...
  21. feb
Advertisement
Add Comment
Please, Sign In to add comment