Skip to content

Instantly share code, notes, and snippets.

@tejas-kr
Created March 12, 2024 06:48
Show Gist options
  • Save tejas-kr/d6df4f69e734565de4a76ef7e805bb99 to your computer and use it in GitHub Desktop.
Save tejas-kr/d6df4f69e734565de4a76ef7e805bb99 to your computer and use it in GitHub Desktop.
Generate Random String (of random characters) Python
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