Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Sunday, March 04, 2018
Python : Find Index of Matching Element in List
Something simple, like
l = ['a', 'b', 'c']
i_c = l.index( 'c' )
Shame that codecademy doesn't tell you you can use [-2:] to retrieve the last two elements..
No comments:
Post a Comment