[Tutor] Creation of function

Magnus Lyckå magnus@thinkware.se
Mon Jun 16 06:02:02 2003


At 09:00 2003-06-16 +0200, Guillaume wrote:
>Hi,
>Is it possible to create whatever
>functions I want (thanx to def)

Yes.

>or are there a limited library of functions?

You can create whatever function you want as long as you only
want reasonable things. :)

There are a number of predefined functions; some that are
always available (unless you hide them by giving something
else their names), and more in standard or third party
modules that you can access by using the import statement.

Besides that, you can certainly create your own functions.

It's usually better to use a predefined function if there is
one that fits the bill, but as a Python programmer, you will
often define new functions.

I think most Python tutorials will show this, and I believe
you have said that you were reading Lutz & Ascher's "Learning
Python". Chapter 4 is all about functions.

Lutz and Ascher assume some prior programming experience though.
If this is all new to you, Alan Gauld's book and his web site
might be a better choice.


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language