Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #code for ATM
- userpin = ["1234", "2345", "3456", "4567"]
- userpass = ["1234", "2345", "3456", "4567"]
- username = ["Rishabh", "Siddharth", "Kashish", "Mahima"]
- userbalance = [20500, 43567, 45672, 67800]
- class Bank:
- def __init__(self, bal=0, index=0):
- #if __name__ == '__main__':
- self.bal = bal
- self.index = index
- def start(self):
- if __name__ == '__main__':
- print("tt=== Welcome to ATM ===")
- inputpin=input("Enter your pin :")
- inputpass= input("Enter your password :")
- b1.pinpasscheck(inputpin,inputpass)
- def pinpasscheck(self,pin,passw):
- self.pin=pin
- self.passw=passw
- inputpin=pin
- inputpass=passw
- index=0
- flag= False
- for i in range(0,len(userpin)):
- if inputpin==userpin[i]:
- index=i
- print(index)
- if inputpass==userpass[index]:
- print("Login Succeeded !")
- flag= True
- b1.operationlist(index)
- if flag==False:
- print("Login invalid. Please check username or password")
- else:
- pass
- else:
- pass
- def operationlist(self,indexval):
- self.indexval=indexval
- index=indexval
- print("n Hello, ", username[index])
- print("""
- 1) Balance
- 2) Withdraw
- 3) Deposit
- 4) Change password
- 5) Quit
- """)
- useroption = int(input("Select an option:"))
- if useroption == 1:
- print("nYour current balance is {}".format(userbalance[index]))
- b1.operationlist(index)
- elif useroption == 2:
- amount= int(input("nEnter amount you want you want to withdraw : Rs"))
- b1.withdraw(amount,index)
- else:
- print("None of the above options selected. Please select any one of the provided options.")
- b1.operationlist(index)
- def withdraw(self, amt, index):
- self.amt= amt
- amount = amt
- self.index= index
- if amount > userbalance[index]:
- print("Oops! Insufficient funds.")
- b1.operationlist(index)
- rembalance = userbalance[index] - amount
- userbalance.remove(userbalance[index])
- userbalance.insert(index, rembalance)
- print("Your remaining balance is: ", userbalance[index])
- b1.operationlist(index)
- b1 = Bank()
- b1.start()
- #code for VirtualDoctor
- import xlrd
- import pandas
- from NewATM import Bank
- path = "symptoms.xlsx"
- book = xlrd.open_workbook(path)
- sheet= book.sheet_by_index(0)
- b2= Bank()
- data= [[sheet.cell_value(r,c) for c in range (sheet.ncols)] for r in range (sheet.nrows)]
- diseaselist= []
- for i in range (1,sheet.nrows):
- diseaselist.append(sheet.cell_value(i,0))
- symptoms=[]
- for i in range (1, data.__len__()):
- tmp= data[i][1:5]
- symptoms.append(tmp)
- print(symptoms)
- inputlist = []
- b2.start() #THIS DOES NOT WORKK !!!!!!!!!!!!!!!!!!!!! WHY ???
Add Comment
Please, Sign In to add comment