random

choice

Return a random element from the non-empty sequence:

import random
valid_chars = '23456789ABCDEFGHJKLMNPQRSTUZWXYZ'
print random.choice(valid_chars)

integer

import random
id = random.randrange(1, 999999)
# or...
id = random.randint(a, b) # a <= N <= b.