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

Резултати

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

Пребарај: #field

当前筛选 #field清除筛选
America 🇺🇸 News & Politics

@America · Post #10046 · 01.11.2025 г., 02:37

😄Field ➖➖➖➖➖➖ 🔘 Field as a noun is a place, covered in grass, with a fence or line around it. A field might be used for animals and crops, or for playing sports on. 🔜The sheep are in this field. 🔜There are 22 players on the field. 🔘 A field can be the area or subject that someone works in. For example, you could work in the field of science. 🔜She is one of the experts in her field. 🔜I've been working in this field for 20 years. 🔘 Field is also a verb. If you field a ball in cricket or baseball, you catch it and throw it to where it should be. We also use the word field at work, people field questions or calls. The two uses of field are similar, you're dealing with a problem. 🔜She is so good at fielding the ball. 🔜I've been fielding calls from angry customers all day! #Field👨‍🏫@America ➖➖➖➖➖➖➖➖➖➖➖➖ 🆕 Crypto News @Money 😁 Crypto Game @Egame 🇺🇸 US News @America 🇯🇵 Japan News @Japan 🇦🇪 UAE News @Dubai ▶️ Popular Movies @Videos 😜 Best Funny Video @Funnys

Hashtags

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