def elem(a, x): found = false for i in a: if(i == x) found = true break if(found): print "tak" else print "nie"