121. (单选题)Python内置函数()(可以返回列表、元组、字典、集合、字符串以及range对象中元素个数。
A. type( )
B. index( )
C. len( )
D. count( )
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-a806-c01a-2cf5d6189000.html
点击查看答案
85. (单选题)以下选项中不符合 Python 语言变量命名规则的是( )
A. TempStr
B. 3ⱣⱤ1
C. ⱣⱤAl
D. l
解析:答案解析:
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-62cc-c01a-2cf5d6189000.html
点击查看答案
6. (多选题)输入一个正整数,输出小于这个数的所有奇数的和,以下程序结果正确的是:
A. n=int(input())result=0foriinrange(n):ifi%2==1:result=result+iprint(result)
B. n = int(input())result = 0for i in range(1, n):if i % 2 == 1:result = result + iprint(result)
C. n = int(input())result = 0for i in range(n):result = result + iprint(result)
D. n = int(input())print(sum([i for i in range(n) if i % 2 == 1]))
https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-bc82-c01a-2cf5d6189000.html
点击查看答案
148. (判断题)使用下标可以访问字符串中的每一个字符
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-de23-c01a-2cf5d6189000.html
点击查看答案
188. (填空题)Plain Textdef Sum(*p):return sum(p)print(Sum(3, 5, 8))运行结果是( )
https://www.shititong.cn/cha-kan/shiti/000dded1-b61f-2df6-c01a-2cf5d6189000.html
点击查看答案
93. (单选题)下列语句中,()在Python中是非法的。
A. x=y=z=1
B. x=(y=z+1)
C. x,y=y,x
D. x+=y
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-71c1-c01a-2cf5d6189000.html
点击查看答案
157. (判断题)通过索引可以修改和访问元组的元素
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-efac-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
点击查看答案
132. ( )输入一个整数,输出其绝对值。将程序写在下方:思考:正数的绝对值不变,负数的绝对值需要加负号变为正数。
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-bf18-c01a-2cf5d6189000.html
点击查看答案
124. (单选题)下列有关函数的说法中,正确的是( )
A. 函数的定义必须在程序的开头
B. 函数定义后,其中的程序就可以自动执行
C. 函数定义后需要调用才会执行
D. 函数体与关键字def必须左对齐
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-ae06-c01a-2cf5d6189000.html
点击查看答案