Home >>Python Random Module >Python Random triangular() Method
Python Random triangular() Method in python returns a random floating number between the two specified numbers i.e x and y but you can also specify a third parameter.
Syntax:random.triangular(low, high, mode)
Parameter | Description |
---|---|
low | It is Optional. The lowest possible outcome to specify the number. The default value is 0 |
high | It is Optional. The highest possible outcome to specify the number. The default value is 1 |
mode | It is Optional. The midpoint between the low and high values by default |
import random
print(random.triangular(14, 45, 15))
import random
print(random.triangular(34, 27, 67))