generate a random number between 1 and 100 in python

To generate a random number between 1 and 100 in Python, you can use the randint() function from the built-in random module. Here's an example:

main.py
import random

random_number = random.randint(1, 100)
print(random_number)
75 chars
5 lines

This code imports the random module, generates a random integer between 1 and 100 using randint(), and then prints the randomly generated number to the console.

gistlibby LogSnag