Jun 25th, 2022
822
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
2. import random
3. letters = ['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', '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']
4. numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
5. symbols = ['!', '#', '\$', '%', '&', '(', ')', '*', '+']
6.
7. print("Welcome to the PyPassword Generator!")
9. nr_symbols = int(input(f"How many symbols would you like?\n"))
10. nr_numbers = int(input(f"How many numbers would you like?\n"))
11.
12. #Eazy Level - Order not randomised:
13. #e.g. 4 letter, 2 symbol, 2 number = JduE&!91
14.
15. import random
17. # for char in range(1, nr_letters +1):
18. #     random_letters = random.choice(letters)
20. #
21. # for numb in range(1, nr_letters +1):
22. #     random_number = random.choice(numbers)
24. #
25. # for symb in range(1, nr_symbols +1):
26. #     random_symbol = random.choice(symbols)
28. #
30.
31.
32.
33. #Hard Level - Order of characters randomised:
34. #e.g. 4 letter, 2 symbol, 2 number = g^2jk8&P
35.
36. import random
38.
39. for char in range(1, nr_letters +1):
40.     random_letters = random.choice(letters)
42.
43. for symb in range(1, nr_symbols +1):
44.     random_symbol = random.choice(symbols)
46.
47. for numb in range(1, nr_numbers +1):
48.     random_number = random.choice(numbers)
50.
54.
55.