Created
May 14, 2020 19:19
-
-
Save Deep18-03/26364234235de2f728e304024cfa1499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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