中国大学MOOC: fo = open(beijing2008.csv, w)ls = [A, B, C, D, E]fo.write(,.join(ls)+ )fo.close()以上代码能实现将一维数据写入CSV文件中.
举一反三
- fo = open(beijing2008.csv, w)l...上代码能实现将一维数据写入CSV文件中.
- fname = input(”请输入要写入的文件:”) fo = open(fname,”w+”) ls = [“唐诗”,”宋词” ,”元曲”] fo.writlines ( ls ) for line in fo: print ( line ) fo.close( ) 上述代码的运行结果为:( )
- 以下文件操作方法,打开后能读取CSV格式文件的选项是:() A: fo = open("123.csv","a") B: fo = open("123.csv","w") C: fo = open("123.csv","x") D: fo = open("123.csv","r")
- 以下文件操作方法,打开后能读取 CSV 格式文件的选项是: A: fo = open(123.csv,w) B: fo = open(123.csv,x) C: fo = open(123.csv,r) D: fo = open(123.csv,a)
- 以下文件操作方法,打开后能读取CSV格式文件的选项是( )。 A: fo =<br/>open("py.csv","r") B: fo =<br/>open("py.csv","x") C: fo =<br/>open("py.csv","w") D: fo =<br/>open("py.csv","a")