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

Резултати

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

Пребарај: #2year

当前筛选 #2year清除筛选

👉Strive to be the first to join the live event on Facebook, Instagram, Zoom at exactly 14:00, London Time, to win the $10.00 giveaway 🤩 👉Remember there is a condition for winning the money! 🚀 👉You must stay till the end of the ceremony at 17:10, London Time, otherwise you will be disqualified from winning 🚨 With the support EXCOINCIAL Team @excoincial #DogData#EXCOINCIAL#EXCHANGE#2YEAR#Anniversary#Ceremony#speakers#Ask#Your#Questions#AMA

LISTENING & ASKING QUESTIONS AT EXCOINCIAL ANNIVERSARY ON 26TH JULY 2020!!! Come and listen to our speakers. Every session of EXCOINCIAL anniversary event comes with a giveaway! We have more than 10 confirmed speakers! Get your questions prepared for our speakers. You are allowed to ask maxmum of two (2) maximum per person. After the end of ceremony the 10 best publicly voted question wins 5 USD each. Get in touch with us through private message to indicate your interest in participating in question session! EXCOINCIAL Team. #Dogdata#EXCOINCIAL#EXCHANGE#2YEAR#Anniversary#Ceremony#speakers#Ask#Your#Questions#AMA