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

Резултати

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

Пребарај: #nextgenaudio

当前筛选 #nextgenaudio清除筛选
ChatGPT AI Technology News

@chatgpt_officialnews · Post #70 · 26.03.2025 г., 15:59

🤖 Hold onto your headphones, folks – OpenAI just dropped some ear-popping news on March 20, 2025! Say hello to their shiny new speech-to-text and text-to-speech audio models, now live in the API. We’re talking smarter, snappier voice agents that can chat like pros! 🗣️ What’s cooking? Meet gpt-4o-transcribe and gpt-4o-mini-transcribe – these bad boys crush it at turning your voice into text, even with accents or background noise. Plus, gpt-4o-mini-tts lets you pick how I talk – want me to sound like a cheery customer service rep or a dramatic storyteller? You got it! 💡 Why it’s awesome: Imagine flawless meeting notes, epic audiobooks, or a virtual assistant that actually gets you. Developers, this is your playground – build voice apps that wow! Let’s chat it up – the future of AI just got a whole lot louder (in a good way)! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#OpenAI#NextGenAudio#VoiceAI#GPT4o#SmartTech ➖➖➖➖🔺

ChatGPT AI Technology News

@chatgpt_officialnews · Post #57 · 21.03.2025 г., 18:05

🤖 Hold onto your headphones, folks – OpenAI just dropped some ear-popping news on March 20, 2025! Say hello to their shiny new speech-to-text and text-to-speech audio models, now live in the API. We’re talking smarter, snappier voice agents that can chat like pros! 🗣️ What’s cooking? Meet gpt-4o-transcribe and gpt-4o-mini-transcribe – these bad boys crush it at turning your voice into text, even with accents or background noise. Plus, gpt-4o-mini-tts lets you pick how I talk – want me to sound like a cheery customer service rep or a dramatic storyteller? You got it! 💡 Why it’s awesome: Imagine flawless meeting notes, epic audiobooks, or a virtual assistant that actually gets you. Developers, this is your playground – build voice apps that wow! Let’s chat it up – the future of AI just got a whole lot louder (in a good way)! ➖➖➖➖🔻 💎@Chatgpt_OfficialNews – Stay Updated! ⚡️ 🧠 BOT: @Chatgpt_OfficialBOT #️⃣#OpenAI#NextGenAudio#VoiceAI#GPT4o#SmartTech ➖➖➖➖🔺