Похожие чаты

Is there a good way to partition whole sentence ?? Hello

hai Hello hai
=> ["Hello", " ", " ", "Hello", " ", "hai"]

14 ответов

8 просмотров

re.split(r"\b", string)

Fan / Ac- Автор вопроса
harꭑony5 (⊙ ◡ ⦿︎) ↺
screenshot

thanks so every word ends with \b

a='ali am' a=[x for x in a.split(' ')]

Don't wanna use any library like Just wanna use crazy algorithm here lol: a1='your crazy text lol' a=list(a1) v,sum=[],'' for i in a: if i!=' ':sum+=i else: v.append(sum),v.append(' ') sum='' v=list(filter(lambda x: x!='',v)) v.append(a1.split()[-1]) print(v)

Fan / Ac- Автор вопроса
Reza
Don't wanna use any library like Just wanna use c...

1. Use telegram mono formatting to format your code sample. 2. re isn't a library but a module in the standard library. 3. No need to do a = list(a1) as strings are iterable in python 4. The part with the filter is not necessary as when you iterate a, no character i will be empty.

Fan / Ac- Автор вопроса
Reza
The use re

nah didnt used re

Fan / Ac- Автор вопроса
Reza
Ik

i think code you shared is good, but its not readable mainly because you didnt formatted and shared raw text

Reza
Lol

To post more than a few lines of code, use a pastebin like: * dpaste.org * linkode.org * bin.kv2.dev * hastebin.com If you are stuck in a terminal, you can use ix.io or paste.rs to paste from the CLI: <command to print output> |& curl -F 'f:1=<-' ix.io <command to print output> |& curl --data-binary @- https://paste.rs

Похожие вопросы

Обсуждают сегодня

я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Всем привет! Массив вводится с клавиатуры, кол-во элементов неизвестно, поэтому я указал arr db 100 dup(?) С нахождением максимума проблем нет, а вот минимум почему-то всегд...
En Vind Av Sorg
11
в сях есть множество как в питоне? для удаление дубликатов
Linus
25
Hi everyone, long time no see! 🐼 recently i want to update our Ergo Eco-System map, can everyone help to find out, which to delete and other new to add in? list it, that i can...
HEROKOO
13
I will wait, no problem, I invested in other project also, but with my 8 years experience I can see when something is not good enough. Last bull market everyone was so excited...
jeronim jurakovic
1
This topic is discussed al lot. Please use the search function for the answers. The same question pops up every two weeks. First check this video https://www.youtube.com/watch...
Enrico
2
If arrr gets implemented on cake wallet. Would that mean arrr/xmr swaps possible in cake wallet like atomic swaps on komodowallet ?
Keks Meister 🏴‍☠️
22
зеленые ноты вижу, а коричневые?
οἰφέω σκάπτω
19
читать файл максимально быстро? странный вопрос))
zamtmn
53
30 BCH videos in Hausa Language successfully delivered. In December 2023, I created a Flipstarter to produce Bitcoin Cash videos in the Hausa language for greater outreach an...
Munnir
9
Карта сайта