'how do I get a random no between 1 and 100 in python?

so, I'm writing a program where I have to randomly pick a number between 1 and 100 excluding 1 and 100 in python, how do I make this happen? I've tried the randint function and the randrange function but both give me 1 as well as 100.



Solution 1:[1]

So, you can write

import random
print(random.randint(2,99))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ali