tutorial |
---|
You can use the randint()
function to get a random integer number. randint()
is an inbuilt function of the random
module in Python3.
The random module offers various useful functions, including randint()
, which generates random whole numbers within a given range passed as parameters. You can use it like this: randint(min_num, max_num)
, where both the minimum and maximum numbers are included in the range.
- The code now is returning random decimal numbers, please update the function code to make it return an integer (no decimal) number between 1 and 10.
- For additional documentation on the
random
module, visit: https://www.tutorialsteacher.com/python/random-module