file=open('users/yourname/desktop/file','w')file.write('helloworld!')这句代码的作用是()。

题目
file=open('users/yourname/desktop/file','w')file.write('helloworld!')这句代码的作用是()。

A.打开一个文件,不管文件在不在

B.打开文件并写入

C.在桌面上打开一个文件(路径得看个人具体情况),w的意思是,如果有则在文件里写入helloworld,如果没有则创建一个文件。

D.打开文件,没有报错

更多“file=open('users/yourname/desktop/file','w')file.write('helloworld!')这句代码的作用是()。 ”相关问题