Advertisement
Guest User

Untitled

a guest
Jan 6th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.23 KB | None | 0 0
  1. #This is what I know so far
  2.  
  3. import time
  4. import sys
  5.  
  6. while True:
  7.     yesorno = input("Are you 18 or older? type y or n to continue:")
  8.     if yesorno == "y":
  9.         print("\nPlease create a username to continue.")
  10.         myUser = input("Create a username: ")
  11.         myPass = input("Create a password: ")
  12.         time.sleep(1)
  13.         print("\nSaving data")
  14.         time.sleep(1)
  15.         print("...\n")
  16.         time.sleep(1)
  17.         while True:
  18.             for userCounter in range(1,6):
  19.                 for passCounter in range(1,6):
  20.                     print("Please enter the credentials you provided to continue. ")
  21.                     myNewUser = input("Username: ")
  22.                     time.sleep(1)
  23.                     if myNewUser == myUser:
  24.                         myNewPass = input("Password: ")
  25.                         time.sleep(1)
  26.                         if myNewPass == myPass:
  27.                             print("Welcome, %s"%(myUser))
  28.                             sys.exit()
  29.                         elif myNewPass != myPass:
  30.                             print("Incorrect Password.")
  31.                             print("Number of Login Attempts: %s"% (passCounter))
  32.                             passCounter += 1
  33.                             if passCounter == 6:
  34.                                 print("You've exceeded your login Attempts for today.")
  35.                                 print("Please try again in 24 hours.")
  36.                                 sys.exit()
  37.                     elif myNewUser != myUser:
  38.                         time.sleep(1)
  39.                         print("Error, Incorrect Username")
  40.                         print("Number of Login Attempts: %s\n"% (userCounter))
  41.                         userCounter += 1
  42.                         time.sleep(1)
  43.                         if userCounter == 6:
  44.                             print("You've exceeded your login Attempts for today.")
  45.                             print("Please try again in 24 hours.")
  46.                             sys.exit()
  47.                     else:
  48.                         print("You did not type anything.\n")
  49.     elif yesorno == "n":
  50.         print("Goodbye.")
  51.         break
  52.     else:
  53.         print("You did not type y or n, please try again.\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement