This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
def random_n_digit(n): | |
range_start = 10**(n-1) | |
range_end = (10**n)-1 | |
return randint(range_start,range_end) | |
print('Random number of digit 3 is', random_n_digit(3)) | |
print('Random number of digit 5 is', random_n_digit(5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment