Created
March 12, 2024 06:48
-
-
Save tejas-kr/d6df4f69e734565de4a76ef7e805bb99 to your computer and use it in GitHub Desktop.
Generate Random String (of random characters) Python
This file contains 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 | |
import string | |
letters = [] | |
letters.extend(string.ascii_lowercase) | |
letters.extend(string.ascii_uppercase) | |
letters.extend((str(i) for i in range(0, 10))) | |
print(letters) | |
print(''.join([random.choice(letters) for i in range(50)])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment