Simple program for class

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
DBB Artist
DBB Artist
Posts: 7137
Joined: Mon Aug 01, 2005 8:47 am

Simple program for class

Post by Isaac » Sat Sep 25, 2010 3:28 pm

This is meant to be used after being imported into the Python terminal. After its loaded each account is its own instance which returns a usable value, like Cash.bal(). Examples:>>> AcPay.add(Cash.bal()-513.30) >>> Cash.add(50000)
To keep track of all the accounts I type dir()
It's simple but I'm a beginner.

Code: Select all

class account:
	def __init__(self):
		self.all = []
	def add(self, dollarval):
	def show(self):
		for transactions in self.all:
			print a,\")  $\", transactions
	def bal(self):
		for transactions in self.all:
		return a
	def u(self):
		del self.all[-1]
Note: python is a hobby of mine, but I use it for school as a calculator.
Post Reply