Example
Return a number between 3 and 9 (both included):
Definition and Usage
The randint()
method returns an integer number selected element from the specified range.
Note: This method is an alias for randrange(start, stop+1)
.
Syntax
random.randint(start, stop)
Parameter Values
Parameter | Description |
---|---|
start | Required. An integer specifying at which position to start. |
stop | Required. An integer specifying at which position to end. |