a=random.randrange(10)
b=random.randrange(10)
c=random.randrange(10)
d=random.randrange(10)
e=random.randrange(10)
file.write("282460000" + str(a) + str(b) + str(c) + str(d) + str(e))
Using 1 random function per digit is not a clever idea, it will not improve randomness of generated numbers. Random functions exist since beginning of computers and are perfectly capable of generating 5 digits numbers.
If your problem comes from leading zeros, there is solutions:
- when you convert number to string, you can use formatting (language dependent)
- or without formatting
a=random.randrange(100000)
b=str(100000+a)
then you cut first char of string, or keep the 5 chars on right of string.