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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #309 · 2 фев.

Метод строки split() разделяет строку на несколько строк по указанному символу >>> "a_b_c".split('_') ['a', 'b', 'c'] Можно указать максимальное количество разделений >>> "a_b_c".split('_', 1) ['a', 'b_c'] Или резать с другой стороны с помощью rsplit() (right split) >>> "a_b_c".rsplit('_', 1) ['a_b', 'c'] А что будет если оставить аргументы пустыми? >>> "a_b_c".split() ['a_b_c'] Получаем список с одним элементом, потому что по умолчанию используется пробельный символ. >>> "a b c".split() ['a', 'b', 'c'] То есть это равнозначно такому вызову? >>> "a b c".split(" ") ['a', 'b', 'c'] Кажется да, но нет! Давайте попробуем добавить пробелов между буквами >>> "a b c".split(" ") ['a', '', '', 'b', '', '', 'c'] И вот картина уже не так предсказуема 😕 А вот что будет по умолчанию >>> "a b c".split() ['a', 'b', 'c'] Всё снова красиво! 🤩 По умолчанию в качестве разделителя используется любой пробельный символ, будь то табуляция или новая строка. Включая несколько таких символов идущих подряд. А также игнорируются пробельные символы по краям строки. >>> "a\t b\n c ".split() ['a', 'b', 'c'] Аналогичный способ можно собрать с помощью регулярного выражения. Но пробелы по краям строки придется обрабатывать дополнительно. >>> import re >>> re.split(r"\s+", ' a b c '.strip()) ['a', 'b', 'c'] Здесь тоже можно указать количество разделений >>> re.split(r"\s+", 'a b c', 1) ['a', 'b c'] А что если мы хотим написать красиво, то есть split() без аргументов, но при этом указать количество разделений? В этом случае первым аргументом передаём None >>> "a\n b c".split(None, 1) ['a', 'b c'] Данный метод не учитывает строки с пробелами, взятые в кавычки 'a "b c" '.split() ['a', '"b', 'c"'] Но для таких случаев есть другие способы. #tricks#basic

Резултати

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

Пребарај: #videogame

当前筛选 #videogame清除筛选
Home decor

@dzdigital3 · Post #18763 · 02.08.2025 г., 17:58

#BlackFriday#Aliexpress M17 Handheld #VideoGame Console 64G 128G Open Source Linux System 4.3inch Screen Portable Pocket Video Player Retro Gaming Conso Price 28.30€ Place your order https://s.click.aliexpress.com/e/_EzGbfbR

Reuters: World

@reutersworldchannel · Post #149206 · 11.10.2021 г., 10:11

Chinese state media wants gaming loopholes closed Chinese state media said loopholes allowing minors to bypass new rules aimed at curbing gaming play time to three hours per week should be removed to 'prevent addiction.' #News#Reuters#China#VideoGame Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Photoshop Tutorial

@Photoshop · Post #3461 · 05.08.2024 г., 00:00

Some of us prefer to have some fun while also learning new things about our favorite subjects😎 #videogame#privacy#fun#security So, in this post, we recommend three video games that are fun, but also help you learn a lot about data privacy, cybersecurity, and related topics💻 🔢Hacknet: A famous hacker known as "Bit" has died, and you must investigate his death. Released in 2015, this game teaches you about real-world hacking techniques and cybersecurity principles. You learn to navigate networks, analyze data, and see the importance of data privacy. 🔢Orwell: It's a narrative-driven game in which you are a government operative who monitors citizens' data to prevent crime. The game raises questions about privacy, surveillance, and the ethical implications of data collection. 🔢Cybersecurity Lab: This game is designed for students, and it puts them in engaging scenarios and challenges to teach them about cybersecurity concepts, including data privacy. Hope you have a lot of fun playing these. Best wishes🌹 🆔Privacy

Rui's Ramble

@RsRamble · Post #590 · 01.07.2024 г., 13:51

旗帜上是法国国旗加上ACU的logo,有点巨大就没能拍进去…… 刺客信条大革命的亚诺·维克特·多里安 拍摄于Doujinfes Khatib D2 (2024-06-30) #acu#assasinscreed#assasinscreedunity#arno#arnodorian#arnovictordorian#cosplay#game#videogame#doujinfes#hometeamkhatib#coliseumoffun#singapore

Yukiokhruner

@yukiokhruner · Post #42 · 16.05.2022 г., 17:10

Alla ricerca di un qui ed un ora dalla forma conveniente per quanto ridotta all'osso. #vaporonda#vaporwave#vapourwave#vaporart#seapunk#webpunk#glitch#glitchart#glitchartistscollective#chillwave#aesthetic#vaporwaveaesthetic#vaporwaveaesthetics#malinconia#melancholy#tristezza#sadness#sadboy#lofi#testaccio#mattatoio#videogioco#videogame#undertale#undertalesans#sans