178. (填空题)Python 语句如下s1=[1, 2, 3, 4]s2=[5,6,7]print(len(s1+s2))以上代码的运行结果是( )
https://www.shititong.cn/cha-kan/shiti/000dded1-b61f-17e8-c01a-2cf5d6189000.html
点击查看答案
9. (多选题)关于字符串的定义,下面选项中正确的有:
A. 'Hello'
B. "Hello"
C. ''
D. ' '
https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-c300-c01a-2cf5d6189000.html
点击查看答案
42. (单选题) 能产生元素为0-9的平方的列表推导式为:
A. [x * 2 for x in range(10)]
B. [x * x for x in range(10)]
C. (x * x for x in range(10))
D. {x * x for x in range(10)}
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-0932-c01a-2cf5d6189000.html
点击查看答案
36. (单选题)用于提前终止循环的流程控制语句是:
A. pass
B. continue
C. break
D. try
https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-fd3d-c01a-2cf5d6189000.html
点击查看答案
74. (单选题)以下选项中不符合 Python 语言变量命名规则的是( )
A. TempStr
B. 3ⱣⱤ1
C. ⱣⱤAl
D. l
解析:答案解析:
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-4c03-c01a-2cf5d6189000.html
点击查看答案
137. ( )找一段英文的文本,统计该文本中单词的出现次数。比如:How are you How are you 统计结果是:{“how”:2, “are”:2,”you”:2},再遍历整个字典,将每个单词出现的次数输出
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-c884-c01a-2cf5d6189000.html
点击查看答案
71. (单选题)
对以上数据,先按照年龄字段降序,若年龄相同再按照身高升序排列正确的语句为(0
A. frame.sortⱣⱤvalues(ascending=['age','height], by=[False,True])
B. frame.sortⱣⱤvalues(by=('age','height), ascending=(False,True))
C. frame.sortⱣⱤvalues(ascending=('age','height), by=(False,True))
D. frame.sortⱣⱤvalues(by=['age','height], ascending=[False,True])
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-458e-c01a-2cf5d6189000.html
点击查看答案
102. (单选题)下列选项中,会输出1,2,3三个数字的是( )
A. for i in range(3)print(i)
B. for i in range (2):print(i+1)
C. aⱣⱤlist=[0,1,2]for i in aⱣⱤlist:print(i+1)
D. i=1while i<3:print (i)i=i+1
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-8514-c01a-2cf5d6189000.html
点击查看答案
106. (单选题)以下代码的输出结果是( )for s in "testatest":if s=="a" or s=="e":continueprint(s,end='')
A. tsttst
B. testatest
C. testtest
D. tstatst
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-8cb3-c01a-2cf5d6189000.html
点击查看答案
87. (单选题)在Python语言中,可以作为源文件后缀名的是( )
A. python
B. pdf
C. py
D. pyc
解析:答案解析:
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-663a-c01a-2cf5d6189000.html
点击查看答案