get last two in a length of unknown length?

Skip Montanaro skip at pobox.com
Thu Aug 19 04:58:52 CEST 2004


    MC> I have a list of varying length. Would someone know the way to get
    MC> the last two values for this? 

mylist[-2:]

Skip



More information about the Python-list mailing list