python how to generate a random number code example

Example 1: python random

# imports random
import random
# randint generates a random integar between the first parameter and the second
print(random.randint(1, 100))

Example 2: how to tell python to create a random numer

#to choose a random number simply do this
import random
print(random.randint(1, 100))

Example 3: random number pythn

import random
n = random.randint(0,22)
print(n)

# Output: 2

Example 4: python random number

from random import randint

print(randint(1,3))

#Possible Outputs#
#1
#2
#3