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 слични објави

Пребарај: #kiambu

当前筛选 #kiambu清除筛选
Addis Standard

@addisstandardeng · Post #22173 · 04.05.2026 г., 10:04

News: Floods and landslides kill at least 18 in #Kenya At least 18 people have died in flooding and landslides caused by heavy rains in multiple parts of Kenya. The police stated on Sunday that landslides were reported in Tharaka Nithi, Elgeyo-Marakwet, and #Kiambu counties in the country’s central and eastern regions. They confirmed that 18 lives had been lost to these incidents and urged caution amid the challenging weather conditions. The East #African country is currently experiencing its seasonal March to May rain season, which usually peaks in the first half of May. However, experts have long warned that human-induced climate change is exacerbating weather conditions in Kenya and other #East_African countries. https://www.aljazeera.com/news/2026/5/3/floods-and-landslides-kill-at-least-18-in-kenya