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

TGINSIGHT SIMILAR POSTS

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

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

Тип строки в Python имеет очень много удобных методов. Сегодня пост про два таких метода которые чаще всего используются "однобоко". Это методы startswith() и endswith() Самый обычный сценарий использования — проверка, начинается ли строка с указанной подстроки? >>> "some_string".startswith("some") True И аналогичная ситуация с зеркальным вариантом этой функции, проверка совпадения с конца >>> "some_string".endswith("some") False Так они используются в большинстве случаев что я видел. Но у этих функций есть еще два варианта использования. 🔸Сравнение нескольких подстрок Для проверки нескольких подстрок в одной строке обычно вызывают эти функции несколько раз. Но на самом деле достаточно передать кортеж со всеми строками один раз. Если будет хоть одно совпадение то функция вернёт True. >>>"my_image.png".endswith(("jpg", "png", "exr")) True 🔸Диапазон поиска Вторым аргументом можно передать индекс символа с которого следует начать сравнение, а третий аргумент это индекс последнего символа. >>> ".filename.ext".startswith("file", 1) True >>> "file_###.ext".endswith('#', 0, -4) True Индексы можно указать отрицательными, что означает отсчёт с конца. #trics#basic

Hashtags

Резултати

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

Пребарај: #fish

当前筛选 #fish清除筛选

Hey Skill Labs community, have you already played our fishing game on Discord?🐠🧩 👉 Join our Discord NOW: https://discord.com/invite/skilllabs 👉 Go to the channel called: #fish (in the offtop section) and see the rules in a pinned message 👉 We are currently hosting tournaments!

Hashtags

TonOrbital

@tonorbital · Post #243 · 25.06.2024 г., 18:01

🎉 Exciting News from #FISH! 🎉 Minting for @RetardinoTON gamepass NFTs is now live! 💫 In the upcoming patch, players can also purchase amazing cosmetic items associated with RetarDino partners. 📈 As a bonus, 50% of the profit will go towards the buyback and burn of #FISH tokens. 🎮 Don't miss out—owning an NFT is your exclusive gateway to play and earn $WFOSS. Let the adventure begin!

Hashtags

Beneficial Fishing - You Got 10 BUSD 🤑 Do you remember that Skill Labs launched a Fishing game on Discord? 🔝 We summarized the first results and decided to give 10 BUSD for TOP-5 on the list 🪝 From now, Skill Labs announcing a small tournament for everyone, you play - you earn 👉 Join our Discord and play: https://discord.gg/skilllabs 👉 Go to the channel named: #fish (the offtop section) The results will be published on May 13th 🚀 🐡🐠🐟

Hashtags

Play in Discord and get rewards 🕹 Hey Skill Guilders, let's play the fishing game using our Discord bot 🦈 👉 Join our Discord: https://discord.gg/skillguilds 👉 Go to the channel called: #fish (the offtop section) 👉 There you will see a pinned message with rules and a tutorial on how to play 🧩 Play the game and complete daily quests using the command: %quests Very soon we will launch a tournament among our community, be ready and train yourself 💪 Join now: https://discord.gg/skillguilds

Hashtags

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