NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import random
import string


def mainMenu():
print("Welcome to the Password Checker and Generator")
print("Please choose one of the following options: ")
print("1. Password Generator")
print("2. Password Checker")
print("3. Exit")
#how to make a log in/register menu
choice = input("Please enter your choice: ")

if choice == "1":
generate_pw()
elif choice == "2":
password_generate()
else:

print("")
exit()

def generate_pw():
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!$%^&*()-_=+0123456789'

number = input('number of passwords?')
number = int(number)

length = input('password length?')
length = int(length)

print('nhere are your passwords:')

for pwd in range(number):
password = ''
for c in range(length):
password += random.choice(chars)
print(password)

#--------------------------------------------------
def check_upper(input):
uppers = 0
upper_list = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z".split()
for char in input:
if char in upper_list:
uppers += 1
if uppers > 0:
return True
else:
return False

def check_lower(input):
lowers = 0
lower_list = "a b c d e f g h i j k l m n o p q r s t u v w x y z".split()
for char in input:
if char in lower_list:
lowers += 1
if lowers > 0:
return True
else:
return False

def check_number(input):
numbers = 0
number_list = "1 2 3 4 5 6 7 8 9 0".split()
for char in input:
if char in number_list:
numbers += 1
if numbers > 0:
return True
else:
return False

def check_special(input):
specials = 0
special_list = "! $ % ^ & * ( ) _ - + =".split()
for char in input:
if char in special_list:
specials += 1
if specials > 0:
return True
else:
return False

def check_len(input):
if len(input) >= 8:
return True
else:
return False


def validate_password(input):
check_dict = {
'upper': check_upper(input),
'lower': check_lower(input),
'number': check_number(input),
'special': check_special(input),
'len' : check_len(input)
}
if check_upper(input) & check_lower(input) & check_number(input) & check_special(input) & check_len(input):
return True
else:
print ("Invalid password! Review below and change your password accordingly!")
print
if check_dict['upper'] == False:
print ("Password needs at least one upper-case character.")
if check_dict['lower'] == False:
print ("Password needs at least one lower-case character.")
if check_dict['number'] == False:
print ("Password needs at least one number.")
if check_dict['special'] == False:
print ("Password needs at least one special character.")
if check_dict['len'] == False:
print ("Password needs to be at least 8 characters in length.")
print

def password_generate():
while True:
password = input("Enter desired password: ")
print
if validate_password(password):
print ("Password meets all requirements and may be used.")
print ()
print ("Exiting program...")
print ()
exit(0)


mainMenu()


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.