lundi 17 août 2015

How to generate multiple 9 digit random numbers in one go and add a prefix number to them in python

I want to generate multiple (n number) 9 digit random numbers in one go in python and then add a prefix digit (say 1) to each of these numbers (making them 10 digit numbers) and then write them to a file? I know how to generate a single random number using:

import random
random.randint(100000000,999999999)

But how do I generate multiple numbers in one go and then a add predetermined prefix digit to each of them before writing them to a file?




Aucun commentaire:

Enregistrer un commentaire