Only Few Seats Left for Advanced Certification Courses on Data Science, ML & AI by E&ICT Academy IIT Roorkee
Apply NowIf we know the file is relatively small compared to the size of our main memory, we can read the whole file into one string using the read
method on the file handle.
Example -
fhand = open('/cxldata/datasets/project/mbox-short.txt')
inp = fhand.read()
fhand.close()
number_of_lines
mbox-short.txt
which is located at /cxldata/datasets/project/mbox-short.txt
read
method on file handlePS - If your logic is correct then your function should return 1910
. You can use "Hint" and "See Answer" if you are stuck.
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...