已知在D.\Python目录下有一个test.dat文件,则下列选项中返回True的是()。

6 查阅

已知在D.\Python目录下有一个test.dat文件,则下列选项中返回True的是()。

A.os.path.isfile('D.\\Python\\test.dat')

B.os.path.isdir('D.\\Python')

C.os.path.exists('D.\\Python')

D.os.path.exists('D.\\Python\\test.dat')

参考答案:

答案:os.path.isfile('D.\\Python\\test.dat');os.path.isdir('D.\\Python');os.path.exists('D.\\Python');os.path.exists('D.\\Python\\test.dat')