В стандартном модуле 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
Just In: World Liberty Finance ( @worldlibertyfi ) sent 500M $WLFI worth $83.12M to #Jump Trading.
Data - @Nansen_ai
https://x.com/OnchainLens/status/2010748644979577089
Follow @onchainlens for more onchain updates
Shoutout to the early donators 🚀💥 You’re our real VIPs for jumping in first and supporting the new ETH memecoin season! 🙌💰
The more you #JUMP into $JUMP, the closer we get to make ETH great again 🌕🚀
Let’s f***ing jump and save Ethereum together!
Whales are starting to #JUMP into our donation 🐳🐳
A 70 #ETH donation just came in! It came from a very old and large wallet holding over 2500 ETH, the #MEGA movement is getting stronger by the day. Join the movement and make memes on Ethereum great again!
https://etherscan.io/tx/0x25b8397cda09027cc3bcc86ff2abf58fa2dc07022204dd8161a7b2630e658b7d
🚀 The wait is over - $JUMP is live! 🚀
Donate now and secure your stake in Jump.fun, the next-generation memecoin launchpad:
🔥 Liquidity War Mode (loot liquidity, win big!)
💰 FREE 6 ETH liquidity loan on Uniswap
⚡️ Community-ownership via $JUMP token
#jumpfun is the key to bring back memecoin FOMO and fun to the Ethereum ecosystem. #MEGA
🌕 Don’t just watch - #jump high, moon higher!
Crypto Summit Guest List Revealed
Notable figures like Kayne West and the Lazarus Group are invited to a major crypto summit. In related news, Mexican billionaire Ricardo Salinas has raised his Bitcoin holdings to 70%, moving away from gold investments. Meanwhile, Jump is resuming its U.S. crypto operations, boosting hiring amid rising trading volumes.
#Crypto#Bitcoin#Summit#Finance#Investing#Market#Jump#Arbitrum#LazarusGroup#Salinas