Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def hitotsu():
- words = ['ball', 'bat', 'bed', 'book', 'boy', 'bun', 'can', 'cake', 'cap', 'car', 'cat', 'cow', 'cub', 'cup', 'dad', 'day', 'dog', 'doll', 'dust', 'fan', 'feet', 'girl', 'gun', 'hall', 'hat', 'hen', 'jar', 'kite', 'man', 'map', 'men', 'mom', 'pan', 'pet', 'pie', 'pig', 'pot', 'rat', 'son', 'sun', 'toe', 'tub', 'van', 'arm', 'bike', 'bird', 'book', 'chin', 'clam', 'club', 'corn', 'crow', 'crowd', 'crib', 'desk', 'dime', 'dirt', 'fang', 'flag', 'fog', 'game', 'heat', 'hill', 'home', 'horn', 'hose', 'joke', 'kite', 'lake', 'maid', 'mask', 'mice', 'milk', 'mint', 'meal', 'meat', 'moon', 'name', 'nest', 'nose', 'pear', 'pen', 'plant', 'rain', 'road', 'rock', 'room', 'rose', 'seed', 'shoe', 'shop', 'show', 'sink', 'snake', 'snow', 'soda', 'sofa', 'star', 'step', 'stew', 'straw', 'table', 'tank', 'team', 'tent', 'test', 'toes', 'tree', 'vest', 'wing', 'woman', 'alarm', 'aunt', 'bait', 'bath', 'bead', 'beam', 'bean', 'boot', 'brick', 'camp', 'deer', 'dock', 'drum', 'dust', 'eye', 'flesh', 'food', 'frog', 'grade', 'grass', 'hook', 'jail', 'jam', 'kiss', 'light', 'loaf', 'lock', 'meal', 'owl', 'pail', 'park', 'plot', 'rake', 'sack', 'sail', 'sea', 'soap', 'song', 'space', 'spot', 'spy', 'tiger', 'toad', 'town', 'tramp', 'tray', 'trip', 'vase', 'water', 'week', 'wish', 'wool', 'yard', 'actor', 'army', 'beef', 'boy', 'cast', 'cave', 'cent', 'coil', 'elbow', 'face', 'gate', 'glue', 'goose', 'hair', 'hot', 'pail', 'pear', 'pest', 'queen', 'quiet', 'scarf', 'twig', 'wood', 'brain', 'coach', 'crate', 'drug', 'feast', 'frame', 'geese', 'honey', 'hope', 'judge', 'lace', 'lamp', 'north', 'patch', 'scale', 'sheet', 'skate', 'sleet', 'stage', 'year']
- number = "1234567890"
- special = "~`!@#$%^&*()_+{}[]<>?"
- alphaLower = "qwertyuiopasdfghjklzxcvbnm"
- alphaUpper = alphaLower.upper()
- alphabet = str(alphaLower + alphaUpper)
- #--------------------------------------------------------------
- while prelude != 0:
- passw = ""
- prelude2 = print("""Choose a password strength.\n
- \t1. Really easy to remember
- \t2. Easy to remember
- \t3. Not that easy to remember\n""")
- select = {"1":"really easy to remember", "2":"easy to remember", "3":"not that easy to remember" }
- choice = input()
- while choice not in select:
- print ("That isn't an option!")
- choice = input()
- if choice == "1":
- print("You chose \'%s\'." % (select['1']))
- for x in range(3):
- a = random.choice(list(random.choice([number,words])))
- passw += a
- if len(passw) >= 7:
- break
- elif choice == "2":
- print("You chose \'%s\'." % (select['2']))
- while len(passw) <= 5:
- for x in range(5):
- a = random.choice(list(random.choice([number,words])))
- passw += a
- if len(passw) > 10:
- break
- elif choice == "3":
- print("You chose \'%s\'." % (select['3']))
- range1 = random.randint(3,4)
- while (len(passw) <= 9):
- a = random.choice(list(random.choice([words,number])))
- b = random.choice(list(random.choice([special,number])))
- passw += random.choice([a,b])
- if (len(passw) >= 7) and (any(number) not in list(passw)):
- passw += random.choice(list(random.choice([number,special,alphaUpper])))
- if len(passw) >= 10:
- if (any(number)) not in list(passw):
- passw += random.choice(list(random.choice([number,special])))
- break
- print("Your password is: " + passw)
- again = input("\nPress any button for another password. Otherwise, press 0 to quit.\n")
- if again == "0":
- input("See you again!")
- break
- prelude = input("""
- Welcome to Password Generator.\nIf you want to quit, press 0. Otherwise, press any button to start.\n*Note: Don't take this too seriously.*\n""")
- if prelude == "0":
- print("See you again!")
- else:
- hitotsu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement