Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - how to separate paragraphs from text?

I need to separate texts into paragraphs and be able to work with each of them. How can I do that? Between every 2 paragraphs can be at least 1 empty line. Like this:

Hello world,
  this is an example.

Let´s program something.


Creating  new  program.
like image 275
kom20 Avatar asked May 15 '26 12:05

kom20


1 Answers

This sould work:

text.split('\n\n')
like image 143
roeen30 Avatar answered May 18 '26 03:05

roeen30



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!