Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- import math
- global today
- today = datetime.date.today()
- list1 = ["|", " " , "!", "@","$" ,"^", "&", "*", "_", "-", "+", "=", ":", ";", "|", "<",".", ">", "?", "/", "~", "`"]
- option = input("Are you a new user select 1\nAre you an existing user select 2\nIf you wich to exit select 3\n")
- if option == "1":
- print("Welcome new user")
- while True:
- username = input("what is your first name?: ")
- if username.isalpha():
- break
- else:
- print("please input a word...")
- while True:
- username1 = input("what is your second name?: ")
- if username1.isalpha():
- break
- else:
- print("please input a word...")
- yearin = input("what is the year you are in?: ")
- yearin = int(yearin)
- newyear = (today.year -(yearin) + 7)
- print(newyear)
- newyear = str(newyear)
- elif option == "2":
- print ("existing user")
- elif option == "3":
- print ("exiting")
- else:
- print("you haven't selefcted a correct option")
- (username[0:1])
- (username1[0:3])
- (newyear[2:4])
- user = (newyear[2:4]+username[0:1]+username1[0:3])
- print(user, "this is your username")
- def files():
- file = open("user.txt","w")
- file.write(user+"\n")
- file.close()
- files()
- def password():
- 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 '$, %, ^, &, *'")
- while True:
- password = input("what is your password: ")
- checker = (sum(1 for c in password if c.isupper()))
- if checker == 0:
- print("You have to have at least one capital in your password: ")
- elif len(password) < 7 or len(password) > 13:
- print("you must have at least 8 - 12 letters in your password: ")
- elif password != list1:
- print("you must have to input at least one character: ")
- else:
- break
- while True:
- password1 = input("please enter the same password: ")
- if password != password1:
- print("they have to be the same please try again: ")
- else:
- print("")
- break
- password()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement