baijum81 (baijum81) wrote,
baijum81
baijum81

any and all built-in functions in Python 2.5

Oh! this is very nice:
$ python2.5
Python 2.5 (r25:51908, Sep 27 2006, 12:21:46) 
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> any
built-in function any
>>> all
built-in function all
>>> print any.__doc__
any(iterable) -> bool

Return True if bool(x) is True for any x in the iterable.
>>> print all.__doc__
all(iterable) -> bool

Return True if bool(x) is True for all values x in the iterable.
>>> any([1,2])
True
>>> all([1,2])
True
>>> any([1,0])
True
>>> all([1,0])
False


Hey, I have made few edits here, (blame livejournal's `pre` tag), noticed it ? :)
Tags: python
Subscribe

  • Good bye LiveJournal, Hello Blogger

    I started using LiveJournal in 2004. It was a great blogging platform back in 2004. But now a days I am finding it very difficult to use. So I am…

  • Web browser automation testing using Selenium and Python

    Recently Selenium 2 has released with it's new WebDriver technology. Selenium WebDriver supports multiple web browsers like Firefox, Chrome and IE.…

  • PyCON Day 2 & 3

    On second day I attended two tutorials specific to Python 3. I am realizing more and more that Python 3 is really a simple & cool language. I…

Comments for this post were disabled by the author