@TFGames · Post #2172 · 16.02.2024 г., 21:41
#PANDEMIC #8 #BALL#POOL#GAMES https://testflight.apple.com/join/fFYcLcjG
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
Пребарај: #pandemic
@TFGames · Post #2172 · 16.02.2024 г., 21:41
#PANDEMIC #8 #BALL#POOL#GAMES https://testflight.apple.com/join/fFYcLcjG
@reutersworldchannel · Post #149253 · 12.10.2021 г., 14:32
Bali surf school owner eagerly awaiting imminent return of foreign tourists A Bali surf school owner is pinning hopes on Indonesia's plan to reopen the island to some foreign tourists from mid-October, after her business suffered due to a lockdown. #Bali#Indonesia#Lockdown#Pandemic#BaliSurfing#Tourism#News#Reuters 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➖
@reutersworldchannel · Post #149302 · 13.10.2021 г., 13:17
October 13, 2021: Gabby Petito, Texas Governor, Debt ceiling fix, U.S borders, La Palma Volcano October 13, 2021: Gabby Petito, Texas Governor, Debt ceiling fix, U.S borders, La Palma Volcano 1. Gabby Petito, the young woman who vanished on a road trip with her boyfriend and later turned up dead in Wyoming, was killed by strangulation, a local coroner said. 2. Texas Governor Greg Abbott's ban on COVID-19 vaccine mandates will likely be superseded by the Biden administration's plan to require shots for workers, but the dueling rules could take months to sort out in court, creating uncertainty for employers with business in the state. 3. The Democratic-controlled U.S. House of Representatives gave final approval to legislation temporarily raising the government's borrowing limit to $28.9 trillion, pushing off the deadline for debt default only until December. 4. The United States will lift restrictions at its land borders with Canada and Mexico for fully vaccinated foreign nationals in early November, ending historic curbs on non-essential travelers in place since March 2020 to address the COVID-19 pandemic. 5. Over 700 residents were ordered to abandon their homes on the Spanish island of La Palma as red-hot lava advanced towards their neighborhood. #GabbyPetito #Wyoming #TexasGovernor #Covid19 #Vaccines #Biden #Democrats #Republicans #UnitedStates #Debt #Canada #Mexico #Borders #Pandemic #LaPalma #Spain #Volcano #News #Reuters 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➖