0% found this document useful (0 votes)
72 views

Computer P3roject Python PDF

The document is about an ATM program created in Python by students Romil, Tushar, and Mudit. The program allows users to select options like checking their bank statement, withdrawing cash, making deposits, and changing their PIN. It stores user accounts, PINs, and balances in lists. The program runs authentication by checking the username and PIN before granting access to account functions.

Uploaded by

Romil Talaich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Computer P3roject Python PDF

The document is about an ATM program created in Python by students Romil, Tushar, and Mudit. The program allows users to select options like checking their bank statement, withdrawing cash, making deposits, and changing their PIN. It stores user accounts, PINs, and balances in lists. The program runs authentication by checking the username and PIN before granting access to account functions.

Uploaded by

Romil Talaich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

2019-2020

COmputer PROJECT
TOPIC – ATM Program In
Python .

SUBMITTED TO:
Ms. Nimisha
Shylesh(hod)
Computer Sc.
Certificate
Name: Romil, Tushar, Mudit Class: XII Sc.
Roll No.
Institution - Hind Zinc School

This is certified to be the bonafide work of the student in the


laboratory during the academic year 2019/2020.

…………….
Teacher In-charge

……………….. ……………….
Examiner’s Signature Principal

Date:………..
Institution Rubber Stamp
ACKNOWLEDGEMENT

It is my foremost duty to express my deep regards and


gratitude to my Computer Sc. teacher Ms. Nimisha Shylesh
under whose guidance and supervision I am able to
undertake this project. It is her who has been my primary
source of inspiration and who motivated, guided and
encouraged me at different stages of this project.

I sincerely express my gratitude to our principal Dr. Bindu


Nair who pushed us forward to make this project a grand
success.

Roll No.

Name- Romil Talaich - _____________

Tushar Sharma - _____________

Mudit Vijay - _____________

Class- XII Science


INDEX

S.No Content Page No.

i Introduction 5

II Program 6

III Outputs 28
INTRODUCTION
Program - ATM

#PROGRAM OF A T M MACHINE (ATM).

#for the program we have to import


some modules.

import getpass #warning module.


import string
import os

# creatinga lists of users, their


PINs and bank statements.
users = ["romil", "tushar",
"mudit"]
pins = ["6450", "4194", "1999"]
amounts = [500000, 100000, 100000]
count = 0
# while loop checks existance of
the enterd username.
while True:
user = input("\nENTER USER
NAME: ")
user = user.lower()
#^The user name required
is in lower case letters.

if user in users:
#Checking the existance to
users in the bank.

if user ==
users[0]:
n = 0
#for name of
user according to index position
of the list users,
#Here at the
0th index there is ROMIL int he
list users.

elif user ==
users[1]:
n = 1
#n=1 is for second
user i.e. at the 1st index of list
users (TUSHAR).

else:

#esle condition
for the last user.
#since here are
only 3 user thats why n=2 i.e. at
second index of
list users the element named is
MUDIT.

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.

while count < 3:

#the loop will terminate beyond 3


since of only 3 users.

print("|------------------
|")
pin =
str(getpass.getpass("|PLEASE ENTER
PIN|: "))
#to enter the pin

'''"getpass is the waring


module, it just convert the
statement into warning i.e. in red
letters.For example: We have
written "enter pin" then it would
be printed as warning and in red
letters.'''

print("|------------------
|")

if pin.isdigit():
if user == "romil":
#checking
for a pirticular user named romil.

if pin ==
pins[0]:
#If the pin
@ 0th index matches the enetred
pin then then
#condition
comes out to be true and the loop
breaks.
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 == "mudit":
#checking for a
pirticular user named mudit.

if pin ==
pins[1]:

'''If the pn @ 1st index matches


the enetred pin then then

condition comes out to be true


and the loop breaks.'''

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":
#checking for a
pirticular user named mudit.
if pin ==
pins[2]:

'''If the pn @ 1st index matches


the enetred pin then then
condition comes out to be true
and the loop breaks.'''

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("|PIN
CONSISTS OF 4 DIGITS|")
print("|----------
--------------|")
count += 1
#In case the user input
more the 4 digit of pin.

# in case of a valid pin-


continuing, or exiting
if count == 3:
#pervent the unauthorised user to
access the pirticular account.
print("|------------------
-----------------|")
print("|||3 UNSUCCESFUL
PIN ATTEMPTS, EXITING|||")
print("|!!!!!YOUR CARD HAS
BEEN LOCKED!!!!!|")
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("| |/\|ACCESS GARNTED|/\|
|")
print("|--------------------------
---|")
print(" ||LOGGED IN
SUCESSFUYLL|| ")
print("|--------------------------
---|")
print("|__________________________
___|")
print(str.capitalize(users[n]),
"~Welcome to ATM~\n\t [:)(:]")
print("|__________ATM
SYSTEM__________|\n\t ~By-
RMT~")

# Main menu

while True:
#os.system("clear")

print("|__________________________
_____|")
response = input("|SELECT
FROM FOLLOWING OPTIONS|:
\n|Statement--(S)| \n|Withdraw--
(W)| \n|Lodgement--(L)|
\n|Change PIN_(P)| \n||Quit--
(Q)|| \n: ").lower()
#To display all the
related options.
print("|------------------
-------------|")

valid_responses = ["s",
"w", "l", "p", "q"]
#List of all the valid
responses.
response = response.lower()
#to convert the letters to
lower case if entered in upper
case.
if response == "s":
print("|----------
----------------------------------
-|")

print(str.capitalize(users[n]),
"|YOU HAVE ", amounts[n],"RUPEES
ON YOUR ACCOUNT.|")
print("|----------
----------------------------------
-|")

elif response == "w":

cash_out =
int(input("|ENTER AMOUNT OF RUPEES
YOU WOULD LIKE TO WITHDRAW|: "))
print("|----------
----------------------------------
-|")
if cash_out%10 !=
0:

print("|AMOUNT
YOU WANT TO WITHDRAW MUST
TO MATCH 100 RUPEES
NOTES|")
print("|--
----------------------------------
------------------|")
elif cash_out >
amounts[n]:

print("|
====================== |")

print("|YOU HAVE INSUFFICIENT


BALANCE|")
print("|
====================== |")
else:
amounts[n]
= amounts[n] - cash_out

print("|YOUR NEW BALANCE IS: ",


amounts[n], "RUPEES|")
print("|--
----------------------------------
----------------|")

elif response == "l":


print
cash_in =
int(input("|ENTER AMOUNT YOU WANT
TO LODGE|: "))
print("|----------
----------------------------------
-|")
if cash_in%10 != 0:

print("|AMOUNT YOU WANT TO LODGE


MUST TO MATCH 100 RUPEES NOTES|")
print("|--
----------------------------------
----------------|")
else:
amounts[n]
= amounts[n] + cash_in

print("|YOUR NEW BALANCE IS: ",


amounts[n], "RPUEES|")
print("")
print("|--
----------------------------------
----|")
elif response == "p":
print("|----------
-------------------|")
print("")
new_pin =
str(getpass.getpass("|ENTER A NEW
PIN|: "))
print("")
print("|----------
-------------------|")
if
new_pin.isdigit() and new_pin !=
pins[n] and len(new_pin) == 4:

print("|--
----------------|")
print("")
new_ppin =
str(getpass.getpass("|CONFIRM NEW
PIN|: "))
print("")
print("|--
-----------------|")
if
new_ppin != new_pin:

print("|-----------------|")

print("~~~~~~~~~~~~~~~~~~~")

print("|PIN MISMATCHED!!!|")

print("~~~~~~~~~~~~~~~~~~~")

print("|-----------------|")
else:

pins[n] = new_pin

print("|NEW PIN SAVED|")


else:

print("~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~")
print("
|NEW PIN MUST CONSIST OF 4 DIGITS
\nAND MUST BE DIFFERENT TO
PREVIOUS PIN|")

print("~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~")
elif response == "q":
exit()

else:
print("|----------
--------|")
print("|RESPONSE
NOT VALID|")
print("|----------
--------|")
Outputs

Logging in :
Lodgement and Pin change:

.
Statement and Withdrawing:
BIBILOGRAPHY
 https://www.google.co.in/

 https://sourceforge.net/projects/pyinvoice/
files/latest/

 https://www.academia.edu/reset_confirmation

You might also like