In Python, how to generate a 12-digit random number? Is there any function where we can specify a range like random.range(12)?
random.range(12)
import random ran
This may not be exactly what you're looking for, but a library like rstr let's you generate random strings. With that all you would need is (leading 0 allowed):
import rstr foo = rstr.digits(12)