Created
July 11, 2021 11:40
-
-
Save chrisguest75/92f5e448d16951719d4ec40e8ff748b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| def complex(length): | |
| characters = [] | |
| for i in range(33, 126): | |
| characters.append(chr(i)) | |
| password = "" | |
| for i in range(0, length): | |
| c = random.choice(characters) | |
| password = password+c | |
| return password | |
| def simple(length): | |
| characters = [] | |
| for i in range(97, 97+(26-1)): | |
| characters.append(chr(i)) | |
| for i in range(65, 65+(26-1)): | |
| characters.append(chr(i)) | |
| for i in range(48, 48+(10-1)): | |
| characters.append(chr(i)) | |
| password = "" | |
| for i in range(0, length): | |
| c = random.choice(characters) | |
| password = password+c | |
| return password | |
| for i in range(0, 10): | |
| print(simple(30)) | |
| print("") | |
| for i in range(0, 10): | |
| print(complex(30)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment