General computer language, syntax question.
ian.g.kelly at gmail.com
Mon Feb 29 09:54:05 EST 2016
On Feb 29, 2016 7:11 AM, <jonas.thornvall at gmail.com> wrote:
> Sorry but would not if (array==empty) suffice and be alot clearer?
In Python, you can just do "if len(array) == 0" or "if not array".
I would prefer this over your suggestion since it doesn't require some
variable named "empty" to have a sensible value set.
On the container test, as others pointed out, Python has the "in" operator.
broad cross-browser support yet.
More information about the Python-list