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

Резултати

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

Пребарај: #butterflies

当前筛选 #butterflies清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #1129 · 14.12.2025 г., 18:11

🌎 Spectacular animal migrations include the annual journey of monarch butterflies, which travel up to 4,800 kilometers from Canada and the U.S. to central Mexico. These butterflies navigate using a combination of environmental cues and an internal sun compass in their antennae. ✨ #migration⚡#butterflies⚡#nature 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1388 · 29.04.2026 г., 12:11

🌎 Monarch butterflies complete a multigenerational migration from Canada to central Mexico, traveling up to 4,500 kilometers. No single butterfly makes the entire round trip; several generations are born and die along the way. ✨ #butterflies⚡#migration⚡#insects 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1282 · 08.02.2026 г., 22:11

🌎 Each year, monarch butterflies migrate up to 4,800 kilometers from Canada and the northern United States to overwinter in central Mexico. Clusters of millions gather on oyamel fir trees, using environmental cues like the angle of sunlight to navigate. ✨ #migration⚡#butterflies⚡#insects 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #756 · 15.09.2025 г., 18:22

🌎 Monarch butterflies in North America complete one of the longest insect migrations, traveling up to 4,800 kilometers from Canada and the U.S. to central Mexico. Each fall, millions gather in mountain forests, forming dense colonies that help them survive winter’s cold. ✨ #butterflies⚡#migration⚡#insects 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #549 · 12.08.2025 г., 20:22

🌎 Some butterflies taste with their feet! Tiny sensors on their legs let them “sample” leaves, ensuring they lay eggs only on the best plants for their caterpillars. ✨ #butterflies⚡#senses⚡#nature 👉subscribe Interesting Planet

12
ПретходнаСтраница 1 од 2Следна