1.

Solve : just a small question about a python program?

Answer»

this is just a small learning excercise I'm doing. Im attempting to make this and combine a number of skills i have learned to see how it WORKS and learn some things. im self teaching myself python and how to use TERMINAL and a few other subjects as i am taking pre recs now for SCHOOL and WANT to have an edge when i start taking computer programming classes
I know the code is amateurish but im self teaching


class budgettracker:
def namebudget(self, budgetname):
self.budgetname=budgetname

def accountbalance(self, acbalance, weekincome, moneyspent):
self.acbalance=acbalance
self.weekincome=weekincome
self.moneyspent=moneyspent

def calculations(self):
currentbalance=(self.acbalance - self.moneyspent)
weeklyallow=(self.weekincome - self.moneyspent)
print ('account name: %s' % self.budgetname)
print ("current balance is $%s" % currentbalance)
print ("this weeks allownace is $%s" % weeklyallow)


currentuser=budgettracker()


currentuser.namebudget=input('account holders name:')
currentuser.accountbalance=input('account balance, weekly income, moneyspent?')
#MY PROBLEM LIES HERE. THE CLASS METHODS FUNCTION PERFECTLY HOW DO I
# DEFINE THE VARIABLES OF THE METHODS WITH AN INPUT?



Discussion

No Comment Found