I'm learning how to use Classes, so far I have achieved the following:
class customer:
def __init__ (self, name, ID, money):
self.name = name
self.ID = ID
self.money = money
def deposit(self, amount):
self.money = self.money+amount
def withdraw(self, amount):
self.money = self.money-amount
mike = customer('Mike', 1343, 1884883)
john = customer('John', 1343, 884839)
steve = customer('Steve', 1343, 99493)
adam = customer('Adam', 1343, 10000)
I would like to create a function that sorts the customers by the amount of money they have but am unsure about how to do so.