Advertisement
Guest User

Complete Python

a guest
Sep 26th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.70 KB | None | 0 0
  1. uname = "TIP123"
  2. pword = "1234"
  3. count = 0
  4.  
  5. while count < 3:
  6.  
  7.     username = input("Enter username: ")
  8.     password = input("Enter password: ")
  9.     if username == uname and password == pword:
  10.         running = True
  11.         print("You entered a correct username and password. Press any Key to proceed to Main Menu")
  12.         input()
  13.         break
  14.     else:
  15.         count = count + 1
  16.         print("INVALID PASSWORD!\n Try Again.")
  17.    
  18. if count == 3:
  19.     running = False
  20.    
  21.    
  22. balance = 1000
  23. while running:
  24.     print("\n\nMenu:")
  25.     print("A. Check Account")
  26.     print("B. Deposit Money")
  27.     print("C. Withdraw Money")
  28.     print("D. Exit")
  29.     choice = input("Enter your choice: ")
  30.     if choice == "A" or choice == "a" :
  31.         print("Your account balance is: " + str(balance))
  32.         continue
  33.     elif choice == "B" or choice == "b" :
  34.         deposit = int(input("Enter your money to deposit: "))
  35.         if deposit > 0 :
  36.             balance = balance + deposit
  37.             print("Deposit successful")
  38.             continue
  39.         else :
  40.             print("Invalid Value!")
  41.     elif choice == "C" or choice == "c" :
  42.         widthraw = int(input("Enter your money to widthraw: "))
  43.         if widthraw < balance and widthraw < 1000 :
  44.             balance = balance - widthraw
  45.             print("Widthrawal successful")
  46.             continue
  47.         else :
  48.             print("Widthrawal Amount must be less than the current balance and 1000")
  49.             continue
  50.     elif choice == "D" or choice == "d" :
  51.         running = False
  52.         continue
  53.     else :
  54.         print("\nDo not be afraid. Take the challenge!")
  55.         continue
  56.  
  57. print("Thank you for using the machine...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement