Advertisement
Guest User

Untitled

a guest
Mar 4th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. import random
  2. def hitotsu():
  3. 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']
  4. number = "1234567890"
  5. special = "~`!@#$%^&*()_+{}[]<>?"
  6. alphaLower = "qwertyuiopasdfghjklzxcvbnm"
  7. alphaUpper = alphaLower.upper()
  8. alphabet = str(alphaLower + alphaUpper)
  9. #--------------------------------------------------------------
  10. while prelude != 0:
  11. passw = ""
  12. prelude2 = print("""Choose a password strength.\n
  13. \t1. Really easy to remember
  14. \t2. Easy to remember
  15. \t3. Not that easy to remember\n""")
  16. select = {"1":"really easy to remember", "2":"easy to remember", "3":"not that easy to remember" }
  17. choice = input()
  18.  
  19. while choice not in select:
  20. print ("That isn't an option!")
  21. choice = input()
  22.  
  23. if choice == "1":
  24. print("You chose \'%s\'." % (select['1']))
  25. for x in range(3):
  26. a = random.choice(list(random.choice([number,words])))
  27. passw += a
  28. if len(passw) >= 7:
  29. break
  30.  
  31. elif choice == "2":
  32.  
  33.  
  34. print("You chose \'%s\'." % (select['2']))
  35. while len(passw) <= 5:
  36. for x in range(5):
  37. a = random.choice(list(random.choice([number,words])))
  38. passw += a
  39. if len(passw) > 10:
  40. break
  41.  
  42. elif choice == "3":
  43. print("You chose \'%s\'." % (select['3']))
  44. range1 = random.randint(3,4)
  45. while (len(passw) <= 9):
  46. a = random.choice(list(random.choice([words,number])))
  47. b = random.choice(list(random.choice([special,number])))
  48. passw += random.choice([a,b])
  49. if (len(passw) >= 7) and (any(number) not in list(passw)):
  50. passw += random.choice(list(random.choice([number,special,alphaUpper])))
  51. if len(passw) >= 10:
  52. if (any(number)) not in list(passw):
  53. passw += random.choice(list(random.choice([number,special])))
  54. break
  55.  
  56. print("Your password is: " + passw)
  57. again = input("\nPress any button for another password. Otherwise, press 0 to quit.\n")
  58. if again == "0":
  59. input("See you again!")
  60. break
  61.  
  62.  
  63. prelude = input("""
  64. 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""")
  65.  
  66. if prelude == "0":
  67. print("See you again!")
  68. else:
  69. hitotsu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement