Python Report
Python Report
Submitted by
Amandeep Kaur
• Profile of the Problem:- We got this problem for work “You task is to
replicate the working of ATM for a single user, let’s say, Mr. John, who has
already successfully logged into her account on the ATM Machine, now, we
will program the next steps he may want to perform.
Like display his name and cash available in his savings account
(Your task is to design and implement the ATM functionality by taking care of
all constraints, for example if minimum cash available is less than 5000 then
system will display low balance)”
choice =0
while (True):
print("\t\t0. Logout and Exit")
print("\t\t1. View Account Balance")
print("\t\t2. Withdraw Cash")
print("\t\t3. Deposit Cash")
print("\t\t4. Change PIN")
print("\t\t5. Return Card")
try:
choice = int(input("Enter number to proceed > "))
print("\n\n")
except:
print("select from the above input")
continue
if choice == 0:
print("Exiting...")
t.sleep(2)
print("You have been logged out. Thank you!\n\n")
break
elif choice in (1, 2, 3, 4, 5):
num_of_tries = 3
while (num_of_tries != 0):
input_pin = int(input("Please enter your 4-digit
PIN > "))
if input_pin == user_pin:
print("Account auhtorized!\n\n")
if choice == 1:
print("Loading Account Balance...")
t.sleep(1.5)
print("Your current balance is Rs.",
user_balance, end="\n\n\n")
break
elif choice == 2:
print("Opening Cash Withdrawal...")
t.sleep(1.5)
while (True):
withdraw_amt = float(input("Enter the
amount you wish to withdraw > "))
else:
print("Cancelling
transaction...")
t.sleep(1)
print("Transaction
Cancelled!\n\n")
break
break
elif choice == 3:
print("Loading Cash Deposit...")
t.sleep(1.5)
break
elif choice == 4:
print("Loading PIN Change...")
t.sleep(1.5)
break
else:
print("Loading Card Return...")
t.sleep(1.5)
print("Returning your ATM Card")
confirm = input("Confirm? Y/N > ")
if confirm in ('Y', 'y'):
print("Card returned successfully!
\n\n")
else:
print("Cancelling process...")
t.sleep(1)
print("Process Cancelled!\n\n")
break
else:
num_of_tries -= 1
print("PIN incorrect! Number of tries left -",
num_of_tries, end="\n\n")
else:
print("Exiting...")
t.sleep(2)
print("You have been logged out. Thank you!\n\n")
break
else:
print("Invalid input!")
print("\t\t0. Enter 0 to Logout and Exit!")
continue