Advertisement
Guest User

a

a guest
Oct 19th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. import datetime
  2. import math
  3. global today
  4. today = datetime.date.today()
  5. list1 = ["|", " " , "!", "@","$" ,"^", "&", "*", "_", "-", "+", "=", ":", ";", "|", "<",".", ">", "?", "/", "~", "`"]
  6. option = input("Are you a new user select 1\nAre you an existing user select 2\nIf you wich to exit select 3\n")
  7. if option == "1":
  8. print("Welcome new user")
  9. while True:
  10. username = input("what is your first name?: ")
  11. if username.isalpha():
  12. break
  13. else:
  14. print("please input a word...")
  15.  
  16.  
  17. while True:
  18. username1 = input("what is your second name?: ")
  19. if username1.isalpha():
  20. break
  21. else:
  22. print("please input a word...")
  23.  
  24.  
  25. yearin = input("what is the year you are in?: ")
  26. yearin = int(yearin)
  27. newyear = (today.year -(yearin) + 7)
  28. print(newyear)
  29.  
  30. newyear = str(newyear)
  31.  
  32. elif option == "2":
  33. print ("existing user")
  34. elif option == "3":
  35. print ("exiting")
  36. else:
  37. print("you haven't selefcted a correct option")
  38.  
  39. (username[0:1])
  40. (username1[0:3])
  41. (newyear[2:4])
  42. user = (newyear[2:4]+username[0:1]+username1[0:3])
  43. print(user, "this is your username")
  44.  
  45. def files():
  46. file = open("user.txt","w")
  47. file.write(user+"\n")
  48. file.close()
  49. files()
  50.  
  51.  
  52.  
  53.  
  54. def password():
  55. print("For setting up a account you need to input a password\nyour password will have to include a 8-12 letters\nhas to have a capital\nwill have to include a symbol e.g '$, %, ^, &, *'")
  56. while True:
  57. password = input("what is your password: ")
  58.  
  59. checker = (sum(1 for c in password if c.isupper()))
  60. if checker == 0:
  61. print("You have to have at least one capital in your password: ")
  62. elif len(password) < 7 or len(password) > 13:
  63. print("you must have at least 8 - 12 letters in your password: ")
  64. elif password != list1:
  65. print("you must have to input at least one character: ")
  66. else:
  67. break
  68. while True:
  69. password1 = input("please enter the same password: ")
  70. if password != password1:
  71. print("they have to be the same please try again: ")
  72. else:
  73. print("")
  74. break
  75.  
  76. password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement