How to read a text file into a string variable and strip newlines?
Toreadafile'scontents,callf.read(size),whichreadssomequantityofdataandreturnsitasastring(intextmode)orbytesobject(inbinarymode).,TheSolution·open(dna.txt,r)opensthefileinreadmode(r).·file.read()readstheentirecontentsofthefileintoastring.,Ihaveate...。參考影片的文章的如下: