Gisselle Martinez@sielletech
Tuve algunos problemas de sintaxis pero los resolvi. Gracias ^^
userEnBD = "sielle"
passwordEnBD = "123456"
balance = 1000
def validateUser(u, c):
if u == userEnBD and c == passwordEnBD:
return True
return False
def login():
print("Welcome to Sielle's Bank!")
user = input("Enter your Username ")
password = input("Enter your Password ")
return validateUser(user, password)
def withraw(value):
if value > balance:
return False, balance
return True, balance - value
def deposit(value):
return True, balance + value
def action(option):
if option == 1:
value = int(input("Please, Write the amount to Deposit "))
return deposit(value)
if option == 2:
value = int(input("Please, Write the amount to Withraw "))
return withraw(value)
return False, balance
def run():
if not login():
print("Invalid user or password")
return
print("What would you like to do?")
option = int(input("1. Deposit or 2. Withraw "))
ok, balance = action(option)
if not ok:
print("Sorry, We cant proccess the transaction, balance:", balance)
else:
print("Action carried out successfully! Your new Balance is:", balance)
run() ```