下面代码的输出结果是( )。 list=[[0,1,2],"123.0","python"] a=all(1ist[0]) b=list[1].split(".") c=ascii(list[2]) print(a,b,c)

admin2021-03-16  18

问题 下面代码的输出结果是(    )。
list=[[0,1,2],"123.0","python"]
a=all(1ist[0])
b=list[1].split(".")
c=ascii(list[2])
print(a,b,c)

选项 A、True[‘123’]‘python’
B、False[‘0’]‘1’
C、True[‘123’,‘0’]‘1’
D、False[‘123’,‘0’]‘python’

答案D

解析 all(x)函数在组合类型变量x中所有元素为真时返回True,为假时返回False,若为空,则返回True,所以a的值为False;b中split()是字符串分隔函数,返回分隔后的值应为[’123’,’0’];C中ascii()的参数是字符串python,所以返回’python’。本题选择D选项。
转载请注明原文地址:https://kaotiyun.com/show/S06p777K
0

随机试题
最新回复(0)