How to generate random strings in Python?
How do you create a random string in Python? I need it to be number then character, repeating until the iteration is done. This is what I created: def random_id(length): number = '0123456789' alpha = 'abcdefghijklmnopqrstuvwxyz' id = '' for i in range(0,length,2): id += random.choice(number) id += random.choice(alpha) return id
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.