Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TimCorkindale
- #This program will generate a username from your first and last name and you student id number, it will also test the strength of your password
- print "This program will create a username for you and test your password strength"
- print ("")
- def username ():
- print " Username Creator "
- first=raw_input ("please type your first name:")
- last=raw_input ("please type your last name:")
- idn=raw_input ("please type your student id number:")
- fname = first[:3]
- lname = last[:3]
- iidn = idn[-3:]
- preuser = [fname,lname,iidn]
- username = "".join(preuser)
- print "your username is :",username
- print ("")
- def passwordtest ():
- print " Password Checker "
- print "this will check the strength of your password"
- print ("")
- print "your password must meet these requirements"
- print ("")
- print "* be at least 7 characters long"
- print "* contain at least 1 uppercase letter"
- print "* contain at least 1 lowercase letter"
- print "* contain at least 1 numeric digit"
- passtrth=0
- while passtrth <= 2:
- password=raw_input ("Please type a password that meets the requirements:")
- upperl=0
- lowerl=0
- digitn=0
- for upper in password:
- if upper.isupper():
- upperl += 1
- for lower in password:
- if lower.islower():
- lowerl += 1
- for digit in password:
- if digit.isdigit():
- digitn += 1
- if len(password) <6 or lowerl ==0 or upperl ==0 or digitn ==0:
- print "your password does not meet the requrments"
- else:
- passtrth = 3
- print "your password meets the requrments "
- playagain = "y"
- while playagain == "y" or "Y":
- username()
- passwordtest()
- playagain=raw_input ("would you like to play again Y/N :")
- if playagain == "N" or "n":
- import time
- print "Thank you for using username creator and password checker"
- time.sleep(5)
- quit()
- else:
- print "Rerunning Program"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement