class S_BANK_ACCOUNT(object):
def __init__(self, name, pincode, balance = 0):
self.name = name
self.pincode = pincode
self.balance = balance
def printBalance(self):
print(f'氏名 : {self.name}様\n残高 : {self.balance}円\n')
def depositMoney(self, money):
self.balance += money
def withdrawalMoney(self, pcode, reqmoney):
if pcode == self.pincode and self.balance >= reqmoney:
self.balance -= reqmoney
return reqmoney
Y2xhc3MgU19CQU5LX0FDQ09VTlQob2JqZWN0KToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBuYW1lLCBwaW5jb2RlLCBiYWxhbmNlID0gMCk6CiAgICAgICAgc2VsZi5uYW1lID0gbmFtZQogICAgICAgIHNlbGYucGluY29kZSA9IHBpbmNvZGUKICAgICAgICBzZWxmLmJhbGFuY2UgPSBiYWxhbmNlCiAgICBkZWYgcHJpbnRCYWxhbmNlKHNlbGYpOgogICAgICAgIHByaW50KGYn5rCP5ZCNIDoge3NlbGYubmFtZX3mp5hcbuaui+mrmCA6IHtzZWxmLmJhbGFuY2V95YaGXG4nKQogICAgZGVmIGRlcG9zaXRNb25leShzZWxmLCBtb25leSk6CiAgICAgICAgc2VsZi5iYWxhbmNlICs9IG1vbmV5CiAgICBkZWYgd2l0aGRyYXdhbE1vbmV5KHNlbGYsIHBjb2RlLCByZXFtb25leSk6CiAgICAgICAgaWYgcGNvZGUgPT0gc2VsZi5waW5jb2RlIGFuZCBzZWxmLmJhbGFuY2UgPj0gcmVxbW9uZXk6CiAgICAgICAgICAgIHNlbGYuYmFsYW5jZSAtPSByZXFtb25leQogICAgICAgICAgICByZXR1cm4gcmVxbW9uZXkK