Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #72045 > unrolled thread
| Started by | Cameron Simpson <cs@zip.com.au> |
|---|---|
| First post | 2014-05-26 12:36 +1000 |
| Last post | 2014-05-26 12:36 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: confused about the different built-in functions in Python Cameron Simpson <cs@zip.com.au> - 2014-05-26 12:36 +1000
| From | Cameron Simpson <cs@zip.com.au> |
|---|---|
| Date | 2014-05-26 12:36 +1000 |
| Subject | Re: confused about the different built-in functions in Python |
| Message-ID | <mailman.10327.1401071834.18130.python-list@python.org> |
On 25May2014 15:55, Deb Wyatt <codemonkey@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 <cs@zip.com.au>
Steinbach's Law: 2 is not equal to 3 -- even for large values of 2.
Back to top | Article view | comp.lang.python
csiph-web