Atm Python Code
Atm Python Code
import string
import os
count = 0
while True:
user = user.lower()
if user in users:
if user == users[0]:
n=0
n=1
#n=1 is for second user i.e. at the 1st index of list users (MUDIT).
else:
n=2
break
else:
#If the required username is not present is not inputed then this esle condition is exectued.
print("----------------")
print("|INVALID USERNAME|")
print("----------------")
# comparing pin
print("|------------------|")
'''"getpass is the waring module, it just convert the statement into waring
print("|------------------|")
if pin.isdigit():
if user == "romil":
if pin == pins[0]:
'''If the pn @ 0th index matches the enetred pin then then
else:
#And if the entered pin not matches with the users pin then this condition get
executed.
count += 1
print("|-----------|")
print("|INVALID PIN|")
print("|-----------|")
print()
if user == "mudit":
if pin == pins[1]:
'''If the pn @ 1st index matches the enetred pin then then
break
else:
#And if the entered pin not matches with the users pin then this condition get
executed.
count += 1
print("|-----------|")
print("|INVALID PIN|")
print("|-----------|")
print()
if user == "tushar":
if pin == pins[2]:
'''If the pn @ 1st index matches the enetred pin then then
break
else:
#And if the entered pin not matches with the users pin then this condition get
executed.
count += 1
print("|-----------|")
print("|INVALID PIN|")
print("|-----------|")
print()
else:
print("|------------------------|")
print("|------------------------|")
count += 1
if count == 3:
print("|-----------------------------------|")
print("|-----------------------------------|")
exit()
#IF the worng pin ie entered more than 3 times the this program will terminate and it automatically
kills the program.
#and if all the entered details are correct then the following codes will get executed..
print("|-----------------------------|")
print("|-----------------------------|")
print("|-----------------------------|")
print("|_____________________________|")
# Main menu
while True:
#os.system("clear")
print("|_______________________________|")
print("|-------------------------------|")
valid_responses = ["s", "w", "l", "p", "q"]#List of all the valid responses.
response = response.lower()
#to convert the letters to lower case iff entered in upper case.
if response == "s":
print("|---------------------------------------------|")
print("|---------------------------------------------|")
elif response == "w":
print("|---------------------------------------------|")
if cash_out%10 != 0:
print("|------------------------------------------------------|")
else:
print("|----------------------------------------------------|")
print("|---------------------------------------------|")
if cash_in%10 != 0:
print("|----------------------------------------------------|")
else:
print("")
print("|----------------------------------------|")
print("|-----------------------------|")
print("")
print("")
print("|-----------------------------|")
print("|------------------|")
print("")
print("")
print("|-------------------|")
if new_ppin != new_pin:
print("|-----------------|")
print("~~~~~~~~~~~~~~~~~~~")
print("|PIN MISMATCHED!!!|")
print("~~~~~~~~~~~~~~~~~~~")
print("|-----------------|")
else:
pins[n] = new_pin
else:
print("|-------------------------------------|")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
exit()
else:
print("|------------------|")
print("")
print("")
print("|------------------|")