Skip to content

Instantly share code, notes, and snippets.

@amirsinaa
Last active January 20, 2021 19:34
Show Gist options
  • Save amirsinaa/7934452fa2acb4bd15e1c9224c0b9099 to your computer and use it in GitHub Desktop.
Save amirsinaa/7934452fa2acb4bd15e1c9224c0b9099 to your computer and use it in GitHub Desktop.
A simple python script to generate random phone numbers
from random import randint
def random_with_N_digits(n):
range_start = 10**(n-1)
range_end = (10**n)-1
return randint(range_start, range_end)
for mciNumbers in range(0,100):
print('0912', random_with_N_digits(7))
@spaco67
Copy link

spaco67 commented Jan 5, 2019

Thanks buddy for this script. The applications for this is endless. However, when my app starts to make monies I shall definately donate to you! Thanks man!

@sajib-4414
Copy link

Thanks a lot

@LinuxLuminaries
Copy link

hello guys!!!
how can i make the program to start printing with specific number starting with 6*, 7*, 8* or 9*

@amirsinaa
Copy link
Author

hello guys!!!
how can i make the program to start printing with specific number starting with 6*, 7*, 8* or

print('6',random_with_N_digits(7),'\t','7',random_with_N_digits(7),'\t','8',random_with_N_digits(7))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment