it is written than readlines is a function still it is used with dot(.)operator like a method. why?

7/15/2016 8:14:55 AM

Noorain Khurshid

2 Answers

New Answer


Method is function of class.


ok @Khurshid dot operator is used to access a method under a class, now readline is a method like read() close() write() defined only under file class. so an object of file class can access these methods.