TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #273 · 26 јул.

В стандартном модуле 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

Резултати

Пронајдени 1 слични објави

Пребарај: #pardon

当前筛选 #pardon清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #3949 · 22.01.2025 г., 10:00

Toncoin Exclusive for Telegram Payments 🔗 *Toncoin becomes the sole cryptocurrency* for internal services in Telegram, as Telegram partners with The Open Network (TON). All in-app payments, including subscriptions and ads, must use Toncoin. Pavel Durov emphasizes enhanced user experience and security. Read more. 💰 *Donald Trump announces The Stargate Project*, an initiative with OpenAI, SoftBank, and Oracle to invest $500 billion in AI data centers in the USA over four years, starting with $100 billion this year. OpenAI will manage the facilities. Learn more. ⚖️ A dissatisfied student was awarded 2.5 million rubles by the court against entrepreneur Eduard Gurinovich for failure to deliver on the promised course content in his CEO advisory program. Find out more. 📰 *Trump pardons Ross Ulbricht*, the Silk Road founder sentenced to life imprisonment. He was a pioneer in the cryptocurrency movement, with Silk Road being one of its first platforms. Details here. #Toncoin#Telegram#AI#DataCenters#Trump#SilkRoad#Crypto#VC#Pardon#OpenAI#Blockchain#Innovation#CryptoMarket#Investment#Entrepreneurs#Legal#TechNews#USA#Darknet#Business#Funding