Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update atm.py #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions atm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import os

# creatinga lists of users, their PINs and bank statements
users = ['user1', 'user2', 'user3','vinkum','charu']
users = ['user1', 'user2', 'user3','user5','user6']
pins = ['1111', '2222', '3333','1133','1429']
amounts = [1000, 2000, 3000, 9999, 8000]
count = 0
# while loop checks existance of the enterd username
while True:
user = input('\nENTER USER NAME: ')
user = input('\nENTER USERNAME: ')
user = user.lower()
if user in users:
if user == users[0]:
Expand Down Expand Up @@ -70,6 +70,30 @@
print('***********')
print('-----------')
print()

if user == 'user4':
if pin == pins[3]:
break
else:
count += 1
print('-----------')
print('***********')
print('INVALID PIN')
print('***********')
print('-----------')
print()

if user == 'user5':
if pin == pins[4]:
break
else:
count += 1
print('-----------')
print('***********')
print('INVALID PIN')
print('***********')
print('-----------')
print()
else:
print('------------------------')
print('************************')
Expand All @@ -96,7 +120,7 @@
print()
print('--------------------------')
print('**************************')
print(str.capitalize(users[n]), 'welcome to ATM')
print(str.capitalize(users[n]), 'Welcome to ATM')
print('**************************')
print('----------ATM SYSTEM-----------')
# Main menu
Expand Down