Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created May 14, 2020 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/26364234235de2f728e304024cfa1499 to your computer and use it in GitHub Desktop.
Save Deep18-03/26364234235de2f728e304024cfa1499 to your computer and use it in GitHub Desktop.
#ATM
def deposit():
amount=int(input("enter the amount you want to deposit"))
global balance
balance=balance+amount
def withdraw():
amount=int(input("enter the amount you want to withdraw"))
global balance
balance -=amount
def check_balance():
global balance
print(f"your current balance is {balance} ")
balance=500
chances=3
for i in range(0,3):
pin=int(input("enter your pin"))
if pin==1234:
while True:
print(f"your current balance is {balance}")
print("Enter your choice")
print("1.withdraw 2.deposit 3.check balance")
option=int(input())
if option==1:
withdraw()
elif option==2:
deposit()
else:
check_balance()
print(f"Now your balance is {balance}")
con=input("do you want yo continue Y or N ")
if con=="N" or con=="n":
break
else:
continue
else:
print("incorrect pin try again")
chances -=1
if chances==0:
print("uabale to login")
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment