[Tutor] operations on lists

marcus lütolf marcus.luetolf at bluewin.ch
Wed Apr 13 15:41:38 EDT 2016


Hello experts

I'am working exercise 5. of 'Practical Programming 2nd edition, .....using Python 3'  (operations on lists).
The following code get's me wrong results:

>>> metals = [['beryllium', 4],['magnesium', 12], ['calcium', 20], ['strontium', 38], ['barium', 56], ['radium', 88]]
>>> max(metals)
['strontium', 38]
>>> min(metals)
['barium', 56]

It should return 
['radium', 88] and 
['beryllium', 4] respectively

What's wrong ?
Marcus.



---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus



More information about the Tutor mailing list