31 lines
836 B
Python
31 lines
836 B
Python
class Card:
|
|
|
|
def __init__(self, id_card, pin, money):
|
|
self.id_card = id_card
|
|
self.pin = pin
|
|
self.money = money
|
|
|
|
def transfer_minus(self, amount):
|
|
if amount > self.money:
|
|
return False
|
|
else:
|
|
self.money = self.money - amount
|
|
return True
|
|
|
|
def transfer_plus(self, amount):
|
|
self.money = self.money + amount
|
|
|
|
def withdraw_money(self, amount):
|
|
if amount > self.money:
|
|
return print("You don't have enough money on your card")
|
|
else:
|
|
self.money = self.money - amount
|
|
return print("Take your money")
|
|
|
|
def top_up(self, amount):
|
|
self.money = self.money + amount
|
|
return print("Operation success")
|
|
|
|
def balance_info(self):
|
|
return print("Your balance is:", self.money)
|