В стандартном модуле random есть две очень похожие функции
random.randint()
random.randrange()
Обе возвращают случайное значение из указанного диапазона
>>> random.randint(10, 20)
12
>>> random.randrange(10, 20)
17
В чем же отличие?
Дело в том что у randrange() есть третий параметр step.
randint() действительно возвращает случайное число из указанного диапазона.
randrange() на первый взгляд делает тоже самое если передать также два параметра.
Но есть указать еще и step то наш диапазон усложняется, то есть в него попадёт не полный ряд значений.
Например, я хочу получить случайное значение из диапазона но только чётное число. Тогда достаточно сделать так:
>>> randrange(10, 20, 2)
16
Таким образом получается что randint это частный случай randrange без указания параметра step.
Еще одно важное отличие в том, что randint() включает в диапазон второе значение а randrange() нет. То есть выражение randrange(10, 20) никогда не вернёт 20, а randint(10, 20) вернёт.
#tricks#basic
🚀 Back to Back profits are made in the Premium Group
🎯🎯#C98/USDT has covered all the target to give a Profit of 22% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain
#C98/USDT analysis :
#C98 is currently in a bearish trend, consistently making new lows. The price is expected to test the resistance zone before resuming its bearish momentum.
TF : 1h
Entry : $0.0872
Target : $0.0822
SL : $0.0900
#C98
Coin98 has successfully broken above the descendingchannel formation on the daily timeframe👀
Now, the price is holding above the previous resistance-turned-supportlevel
A bounce from the support zone could push the price toward targets at $0.077, $0.093, and $0.130
#C98 result
1st target achieved in just 15 hours✅
One more quick profit 6%💰🤑
👉 More quick profit signals available in premium channel. Hurry up 🏃♂👇
☎️ Contact @FutureExpertAdmin