Please explain randint
Whats the randint in this line code "print(random.randint(1,100))" means??
1 answers ( 0 marked as helpful)
Hey Chong,
Thank you for reaching out!
As explained in the Python documentation, the randint(a, b)
function returns a random integer between a
and b
, inclusive.
https://docs.python.org/3/library/random.html#random.randint
In your specifict example, the function returns an integer between 1 and 100 inclusive.
Kind regards,
365 Hristina