You are on page 1of 9

Topic:- Python

Project:- Automated Teller Machine (ATM)

Submitted to:- ajmer Sir


Submitted by:- khushi
Luv
harsha
About python:-
Python is an open source, object-oriented, high level
programming language developed by Guido van Rossum in
1991 at the National Research Institute for mathematics and
computer Science, the Netherlands. It is presently owned by
Python Software Foundation(PSF).
Python is based on the ABC language, a teaching language
created to replace the programming language BASIC, which
was developed earlier.
Python is a general-purpose programming language that can
be used effectively to build a kind of program that does not
require direct access to the computer hardware.

Python is based on the ABC language and was inspired by


the famous BBC comedy show Monty Pyhton’s Flying
Circus.
Aim:- A program to create a atm machine in python.

Solution:-

users=['Khushi','Luv','Harsha']

pins=['1111','2222','3333']

amounts=[700000000,699999999,699999998]

count=0

user=input('Enter user name:')

if user in users:

if user== users[0]:

n=0

elif user == users[1]:

n=1

else:

n=2

else:

print('Invalid username')

while count<3:

pin=str(input('Please enter pin:'))

if pin.isdigit():

if user == users[0]:
if pin ==pins[0]:

break

else:

print('Invalid Pin')

if user == users[1]:

if pin == pins[1]:

break

else:

print('Invalid pin')

if user == users[2]:

if pin == pins[2]:

break

else:

print('Invalid pin')

else:('Pin consists of 4 digits')

print('Login successfil, Continue')

print('------ATM SYSTEM-------')

r=[]

i=0

while i<1000000:

response=input('SELECT FROM FOLLOWING OPTIONS:


\nStatement(s) \nWithdraw(w) \nLodgement(l) \nChange PIN(p)
\nQuit(q)\n:')
valid_responses=['s','w','l','p','q']

if response =='s':

print('You have',amounts[n],'Rupees on your account.')

elif response =='w':

cash_out=int(input('Enter amount you would like to


withdraw:'))

if cash_out>amounts[n]:

print('You have insufficient balance')

else:

amounts[n]=amounts[n] - cash_out

print('Your new balance is:', amounts[n],'Rupees')

elif response =='l':

cash_in=int(input('Enter amount you want to lodge:'))

amounts[n]=amounts[n]+cash_in

print('Your balance is',amounts[n],'Rupees')

elif response =='p':

new_pin=str(input('Enter a new pin:'))

if len(new_pin) ==4:

new_ppin=str(input('Comfirm new pin:'))

if new_ppin !=new_pin:

print('Pin mismatch')

else:

pins[n]=new_pin
print('New pin saved')

else:

print('New pin must consist of 4 digits')

elif response =='q':

exit()

else:

print('Response not valid')

r.append(response)

i+=1
OUTPUT:-

Enter user name:Khushi

Please enter pin:1111

Login successfil, Continue

------ATM SYSTEM-------

SELECT FROM FOLLOWING OPTIONS:

Statement(s)

Withdraw(w)

Lodgement(l)

Change PIN(p)

Quit(q)

:s

You have 700000000 Rupees on your account.

SELECT FROM FOLLOWING OPTIONS:

Statement(s)

Withdraw(w)

Lodgement(l)

Change PIN(p)

Quit(q)

:w

Enter amount you would like to withdraw:700

Your new balance is: 699999300 Rupees


SELECT FROM FOLLOWING OPTIONS:

Statement(s)

Withdraw(w)

Lodgement(l)

Change PIN(p)

Quit(q)

:l

Enter amount you want to lodge:800

Your balance is 700000100 Rupees

SELECT FROM FOLLOWING OPTIONS:

Statement(s)

Withdraw(w)

Lodgement(l)

Change PIN(p)

Quit(q)

:p

Enter a new pin:7878

Comfirm new pin:7878

New pin saved

SELECT FROM FOLLOWING OPTIONS:

Statement(s)

Withdraw(w)
Lodgement(l)

Change PIN(p)

Quit(q)

:q

You might also like