(单选题) 以下语句执行后a、b、c的值是( )。
a= “watermelon”
b= “strawberry”
c= “cherry”
if a > b:
c = a
a = b
b = c
A. watermelon strawberry cherry
B. watermelon cherry strawberry
C. strawberry watermelon watermelon
D. strawberry cherry watermelon
https://www.shititong.cn/cha-kan/shiti/0005aef5-22cd-f423-c0f2-8b6872ff1700.html
查看题目
(单选题)以下程序的输出结果是( )。ls1 = [1,2,3,4,5]ls2 = [3,4,5,6,7,8]cha1 = []for i in ls2:if i not in ls1:cha1.append(i)print(cha1)
A. (6, 7, 8)
B. (1,2,6, 7, 8)
C. [6, 7, 8]
D. [1,2,6,7,8]
https://www.shititong.cn/cha-kan/shiti/00002478-6bea-12c6-c00c-0da1455aeb00.html
查看题目
(单选题)设str1 = 'python',语句print(str1.center(10,'*'))的执行结果是( )。
A. python****
B. **python**
C. ****python
D. SyntaxError
https://www.shititong.cn/cha-kan/shiti/0005b643-0f6c-dec8-c0f2-8b6872ff1700.html
查看题目
(单选题)下面代码的输出结果是( )。s =[“seashell”,”gold”,”pink”,”brown”,”purple”,”tomato”]print(s[1:4:2])
A. [‘gold’, ‘brown’]
B. [‘gold’,’pink’,’brown’,’purple’,’tomato’]
C. [‘gold’,’pink’,’brown’]
D. [‘gold’, ‘pink’]
解析:
https://www.shititong.cn/cha-kan/shiti/00002478-6bea-0dcf-c00c-0da1455aeb00.html
查看题目
(单选题)以下关于Python语言复数类型的描述中,错误的是( )。
A. 复数可以进行四则运算
B. 实部不可以为0
C. Python语言中可以使用z()real和z()imag分别获取它的实部和虛部
D. 复数类型与数学中复数的概念一致
https://www.shititong.cn/cha-kan/shiti/0005b643-0f6c-d9e3-c0f2-8b6872ff1700.html
查看题目
(单选题)利用IDLE进行交互式编程,其中“>>>”符号是()。
A. 文件输入符
B. 运算操作符
C. 逻辑运算符
D. 命令提示符
https://www.shititong.cn/cha-kan/shiti/0005b360-2002-b569-c0f2-8b6872ff1700.html
查看题目
(单选题) 下面代码的输出结果是( )。
for s in “HelloWorld”:
if s==“W”:
continue
print(s,end="")
A. Hello
B. World
C. Helloorld
D. HelloWorld
https://www.shititong.cn/cha-kan/shiti/0005aef5-22cd-e2d9-c0f2-8b6872ff1700.html
查看题目
(单选题)关于Python语言的特点,以下说法错误的是()。
A. 支持中文
B. 语法简洁
C. 依赖平台
D. 类库丰富
https://www.shititong.cn/cha-kan/shiti/0005b360-2002-962c-c0f2-8b6872ff1700.html
查看题目
(单选题) 执行以下程序,输入la,输出结果是( )。la = ‘python’try:s = eval(input(‘请输入整数:’))ls = s*2print(ls)except:print(‘请输入整数’)
A. 请输入整数
B. la
C. python
D. pythonpython
https://www.shititong.cn/cha-kan/shiti/0005aef5-22cd-dfdb-c0f2-8b6872ff1700.html
查看题目
(单选题)下面关于Python语言的说法正确的是( )。
A. Python不支持面向对象程序设计
B. Python中使用的所有函数库,都是采用Python语言编写的
C. Python中的内置函数需要用关键字import来导入,而不能直接使用
D. Python中如果导入了某个模块,在后面的代码中就可以使用它的所有公共函数、类和属性
https://www.shititong.cn/cha-kan/shiti/0005b360-2002-c937-c0f2-8b6872ff1700.html
查看题目