Generate Random 5-Digit Number in Python
Here's an example code to generate a random 5-digit number in Python:
import random
# Generate a random number between 10000 and 99999
random_number = random.randint(10000, 99999)
print(random_number)
This code uses the 'random' module to generate a random integer between 10000 and 99999, which is a 5-digit number. The 'randint()' function takes two arguments, the minimum and maximum values of the range to generate a random number from. The code then prints the random number to the console.
原文地址: https://www.cveoy.top/t/topic/lLeZ 著作权归作者所有。请勿转载和采集!