Last answered:

18 Apr 2023

Posted on:

17 Apr 2023

0

Please explain randint

Whats the randint in this line code "print(random.randint(1,100))" means??

1 answers ( 0 marked as helpful)
Instructor
Posted on:

18 Apr 2023

0

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

Submit an answer