Create random string with a char + 2 numbers - python -


two questions:

  1. how create char+number random string. 1 char , 2 digit numbers example: u12 or w82

  2. how create random 5 digit number no 0 @ beginning: 02345 , 03243

1)

import random, string "%c%02d" % (random.choice(string.uppercase), random.randint(0, 99)) 

2)

import random random.randint(10000, 99999) 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -