Home >>Python Random Module >Python Random randrange() Method
Python Random randrange() Method in python is used to returns a selected elements randomly from the specified range(start, stop, step).
Syntax:random.randrange(start, stop, step)
Parameter | Description |
---|---|
start | It is Optional and is used at which position to start, its default value is 0. |
stop | It is Required and is used at which position to end. |
step | It is Optional and is used to specify the incrementation their default value 1. |
import random
print(random.randrange(5, 14))
import random
print(random.randrange(12, 22))