On 25May2014 15:55, Deb Wyatt <codemon...@inbox.com> wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
each_item.isalpha()
and some are called like 'normal'
sum(numlist)
How do you know/remember which way to call them?
Documentation.
However, some context:
each_item.isalpha() is not a builtin function as such. It is a method of the
"str" class.
Whereas "sum" _is_ a builtin function, a globally known name which can be
accessed and used without explicitly importing any module.
There's an explicit list of the builtin functions in the Python doco.
For a class, you can look at the doco for the class ("String methods" in the
python doco, for the "str" class), or run:
help(str)
at the interactive Python prompt.
Cheers,
Cameron Simpson <c...@zip.com.au>
Steinbach's Law: 2 is not equal to 3 -- even for large values of 2.
--
https://mail.python.org/mailman/listinfo/python-list