This is an example of a module. Modules are meant to be imported into another program and used, not run stand alone.
Showing posts with label method. Show all posts
Showing posts with label method. Show all posts
Tuesday, August 4, 2015
Sunday, June 14, 2015
Creating and Accessing Attributes
The constructor method in this program has the attribute of name. The __str__() method creates a string representation of the object. See different ways to access attributes in the program below.
Monday, October 13, 2014
Creating and Importing Modules
A module can be used to save variables and methods. Modules can then be imported into a method. See example below.
Constructors
A constructor is a function that initializes immediately as soon as the objects is created. See example below.
Subscribe to:
Posts (Atom)