Похожие чаты

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

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

14 ответов

27 просмотров

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

Fan / Ac- Автор вопроса
Link 🪈
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

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта