Get item from set

Johannes Bauer dfnsonfsduifb at gmx.de
Sun Apr 26 08:23:40 EDT 2009


Johannes Bauer schrieb:

> Is there something like the "getelement" function? How can I do what I want?

One side note: The obvious trivial solution:

def findset(s, e):
	for i in s:
		if e == i:
			return i
	return None

is because of its complexity of O(n) against the native O(log n) out of
the question...

Kind regards,
Johannes

-- 
"Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit,
verlästerung von Gott, Bibel und mir und bewusster Blasphemie."
         -- Prophet und Visionär Hans Joss aka HJP in de.sci.physik
                         <48d8bf1d$0$7510$5402220f at news.sunrise.ch>



More information about the Python-list mailing list