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 class. Show all posts
Showing posts with label class. Show all posts
Tuesday, August 4, 2015
Friday, June 26, 2015
Wednesday, June 17, 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.
Tuesday, November 25, 2014
Monday, November 24, 2014
Monday, October 13, 2014
Constructors
A constructor is a function that initializes immediately as soon as the objects is created. See example below.
Update to Market Evaluation Program
An update to the Stock Market Evaluation Program that utilizes Classes and Objects to give some additional information in the form of Strings based on user inputs.
Saturday, October 4, 2014
Thursday, October 2, 2014
Object Oriented Programming
An object contains built in attributes. These attributes can be data and/or methods. Functions associated with an object are referred to as methods.
Before an object can be created, a class must be created. A class is a blueprint for an object.
Many objects can refer to the same class.
See below for two examples of creating a class, and then creating an object.
Before an object can be created, a class must be created. A class is a blueprint for an object.
Many objects can refer to the same class.
See below for two examples of creating a class, and then creating an object.
Subscribe to:
Posts (Atom)