PYTHON: generate random numbers in a range .. Example: 0 - 100

0

Good!

I would like to know if with phyton you could generate a random number in a range, for example that the range is 0-100 ..

It is for a task of a course that I am doing, if you could help me I would appreciate it ..

    
asked by Ed Gaona 28.01.2018 в 18:16
source

1 answer

3

Good day.

Look at the following link, in the second subtitle you can find the way to generate a random number according to two parameters that you pass, which would be the range you want, additional, explains the functionality of other methods around random :

link

from random import randint

print(randint(1, 50)) //Donde 1 y 50 son los rangos.
    
answered by 28.01.2018 в 18:22