write lines ( ls ) for line in fo : print ( line ) fo . close ( ) A python 和 c 同行输出B python 和 c 分 行输出C没有输出D以上都不对

以下代码执行完毕后输出什么内容 (  )

 fname = input ( 请输入文件 ) 

fo = open ( fname w + )

ls = [ python , c ]

 fo . write lines ( ls ) 

for line in fo : print ( line )

 fo . close ( ) 

A python 和 c 同行输出

B python 和 c 分 行输出

C没有输出

D以上都不对

参考答案与解析:

相关试题

执行下列Python程序,输出结果是什么?a='python'b="python"print(a==b)A.pythonB.TypeError出错C.True

执行下列Python程序,输出结果是什么?a=pythonb="python"print(a==b)A.pythonB.TypeError出错C.True执行下

  • 查看答案
  • Python3.x和Python2.x唯一的区别就是:print在Python2

    [主观题]Python3.x和Python2.x唯一的区别就是:print在Python2.x中是输出语句,而在Python3.x中是输出函数。此题为判断题(对,错)。

  • 查看答案
  • 执行下列 Python 程序,输出结果是什么? a = 5 > 3 b = 23 ! = 20 c = "python" == "Python"

    执行下列 Python 程序,输出结果是什么? a = 5 > 3 b = 23 ! = 20 c = "python" == "Python" d = 34

  • 查看答案
  • A) on£­digit B) on£­cable C) on£­line D)

    [单选题]A.) on-digitB.) on-cableC.) on-lineD.) on-data

  • 查看答案
  • 执行下列 Python 程序,输出结果是什么( ) a = True b = 5.6 < 5 c = " python " = = &quo

    执行下列 Python 程序,输出结果是什么( ) a = True b = 5.6 < 5 c = " python " = = "

  • 查看答案
  • 执行下列Python程序,输出结果是什么?a='computer'b="Computer"print(a==b)A、pythonB、TypeError出错C、Tru

    执行下列Python程序,输出结果是什么?a=computerb="Computer"print(a==b)A、pythonB、TypeError出错C、Tru

  • 查看答案
  • Fo them there are four choices marked A),B),C)and

    Fo them there are four choices marked A),B),C)and

  • 查看答案
  • Python语句 print(0xA + 0xB)的输出结果是()

    Python语句 print(0xA + 0xB)的输出结果是()A. 0xA + 0xBB. A + BC. 0xA0xBD. 21

  • 查看答案
  • 执行下列Python程序,输出结果是什么?( )x=True y=False w=False z=True print(not((x and y)or(w or z)))A 0 B 1 C Tr

    执行下列Python程序,输出结果是什么?( )x=True y=False w=False z=True print(not((x and y)or(w

  • 查看答案
  • 执行下列Python程序,输出结果是什么?a=1.5&gt;0.5b=5.6&lt;5c=34&lt;=34print(not( (a or b) )and c)A、0B、1C

    执行下列Python程序,输出结果是什么?a=1.5>0.5b=5.6<5c=34<=34print(not( (a or b) )and c)A、0B、1C、

  • 查看答案