How can i delete some components of the file | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can i delete some components of the file

Imagine that i have file which contains the following sentences : "hello world" "hello python" How can i delete a sentence ?

17th Aug 2017, 11:49 AM
kazuto
1 Answer
+ 1
erm...read the file, then open in write mode and write only the lines you want to keep back to it?
17th Aug 2017, 5:20 PM
Ralph Landon
Ralph Landon - avatar