Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- file = open("bank.txt", 'r')
- account_number = []
- balance = []
- name = []
- while True:
- line = file.readline().rstrip()
- if line == "":
- break
- account_number.append(line)
- line = file.rimporeadline().rstrip()
- balance.append(int(line))
- line = file.readline().rstrip()
- name.append(line)
- file.close()
- print(account_number)
- print(balance)
- print(name)
- def new_account():
- new_name = input("What is your name? ")
- new_account_number = random.randrange(111111, 999999)
- if str(new_account_number) in ("bank.txt"):
- number = random.randrange(111111, 999999)
- new_account_deposit = input("Would you like to deposit into your new account? (Y/N)")
- try:
- if new_account_deposit == 'Y' or new_account_deposit == 'y':
- new_balance = input("How much would you like to deposit?")
- elif new_account_deposit == 'N' or new_account_deposit == 'n':
- new_balance = 0
- except:
- print("Please enter Y or N")
- print("These are your new bank account details:\nName:",new_name,"\nAccount Number:",new_account_number,"\nAccount Balance:",new_balance)
- #def remove_account():
- #def deposit():
- #def withdraw():
- def main():
- new_account()
- #remove_account()
- #deposit()
- #withdraw()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement