I often find myself storing data in a list of tuples, and I want to ask
questions like "what is the index of the first tuple whose 3rd element
is x", or "give me the first tuple whose 2nd element is y".
I know I can do [elem for elem in lst if elem[3] == x][0] or (elem for
elem in lst if elem[2] =
geon wrote:
> Ximo wrote:
> > Can I do a function which don't return anything?
> Nothing is None, or isnt?
A woodman was carrying a sack full of chopped wood on his back. His
sack was heavy and filled beyond its limit. The man, bent under his
bulky burden, was struggling not to drop any of the woo
Christopher Subich wrote:
> In experimenting with this, I found a slight... fun issue involved in
> this. Selection_get is the correct method to call, but it doesn't quite
> work out of the box.
> >>> g.selection_get()
> Traceback (most recent call last):
>File "", line 1, in ?
>File "C:\