On Wed, Oct 6, 2010 at 4:16 AM, T MURPHY <[email protected]> wrote:
> how do i go about creating a class in python.
By using the "class" keyword.
Example:
class Fruit(object):
def __init__(self, name)
self.name = name
class Apple(Fruit):
def __init__(self):
super(Apple, self).__init__("apple")
apple = Apple()
print apple.name
For more information, I suggest you start reading
the python tutorial (1)
cheers
James
1. http://docs.python.org/tutorial/
--
-- James Mills
--
-- "Problems are solved by method"
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor