loading...

re: Daily Challenge #39 - Virus VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Python : import re def fix_virus(document): doc = document.lower().capitalize() return re.sub(r'ie','ei',doc) Python one-liner : fix_v...
 

If it's a document, it will contains multiple sentences and capitalize is only uppercasing the first letter of a string

 

Ok then split document by lines and call the function :

document_splitted = document.split('\n')
for line in document_splitted:
    fix_virus(line)
    ....

Or capitalize each line of the document after lowering :)

Your solution is very good btw. Good job

Code of Conduct Report abuse