1.

How do you get the name of a file from a file object (fp)?(a) fp.name(b) fp.file(name)(c) self.__name__(fp)(d) fp.__name__()I had been asked this question in class test.Query is from Files topic in portion Regular Expressions and Files of Python

Answer»

Right choice is (a) fp.name

Easy EXPLANATION - name is an ATTRIBUTE of the FILE OBJECT.



Discussion

No Comment Found

Related InterviewSolutions