APP下载
首页
>
财会金融
>
宏观经济学选择题
搜索
宏观经济学选择题
题目内容
(
简答题
)
141. (简答题)文件“静夜思.txt”保存在当前文件夹下,其文件的编码为“utf-8”,现在需要打开并读取文件内容,可以获得以下格式的输出的程序代码段:静夜思李白床前明月光,疑似地主霜。举头望明月,低头思故乡。

答案:with open("静夜思.txt", 'r', encoding='utf-8') as file:for line in file:print(line.strip())

宏观经济学选择题
176. (填空题)布尔类型的值包括True和( )。
https://www.shititong.cn/cha-kan/shiti/000dded1-b61f-13fc-c01a-2cf5d6189000.html
点击查看题目
125. (单选题)使用( )关键字创建自定义函数
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-b01f-c01a-2cf5d6189000.html
点击查看题目
159. (判断题)元组是不可变的,不支持列表对象的inset()、remove()等方法,也不支持del命令删除其中的元素,但可以使用del命令删除整个元组对象。
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-f303-c01a-2cf5d6189000.html
点击查看题目
23. (多选题)ls = [25, 13, 36, 1]lst = [88]将列表lst中的元素加到列表ls末尾,输出列表[25, 13, 36, 1, 88]的正确的选项有:
https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-e0b5-c01a-2cf5d6189000.html
点击查看题目
73. (单选题)对以上数据,以性别字段作为分组依据,并对分组后的数据重新排序的语法正确的是()
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-49eb-c01a-2cf5d6189000.html
点击查看题目
186. (填空题)函数可以有多个参数,参数之间使用( )分隔
https://www.shititong.cn/cha-kan/shiti/000dded1-b61f-2a1e-c01a-2cf5d6189000.html
点击查看题目
98. (单选题)有一个函数关系表如下所示:下面程序段中,能正确表示上面关系的是()
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-7ca9-c01a-2cf5d6189000.html
点击查看题目
79. (单选题)可变参数*args传入函数时的存储方式为( )
https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-55fb-c01a-2cf5d6189000.html
点击查看题目
18. (多选题)以下列表操作方法中,属于原地操作,无返回值的为:
https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-d591-c01a-2cf5d6189000.html
点击查看题目
22. (多选题)ls = [25, 13, 36, 1]ls为一个列表,删除其中元素13,输出列表[25, 36, 1]的正确的选项有:
https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-dea1-c01a-2cf5d6189000.html
点击查看题目
首页
>
财会金融
>
宏观经济学选择题
题目内容
(
简答题
)
手机预览
宏观经济学选择题

141. (简答题)文件“静夜思.txt”保存在当前文件夹下,其文件的编码为“utf-8”,现在需要打开并读取文件内容,可以获得以下格式的输出的程序代码段:静夜思李白床前明月光,疑似地主霜。举头望明月,低头思故乡。

答案:with open("静夜思.txt", 'r', encoding='utf-8') as file:for line in file:print(line.strip())

分享
宏观经济学选择题
相关题目
176. (填空题)布尔类型的值包括True和( )。
https://www.shititong.cn/cha-kan/shiti/000dded1-b61f-13fc-c01a-2cf5d6189000.html
点击查看答案
125. (单选题)使用( )关键字创建自定义函数

A. function

B. func

C. def

D. procedure

https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-b01f-c01a-2cf5d6189000.html
点击查看答案
159. (判断题)元组是不可变的,不支持列表对象的inset()、remove()等方法,也不支持del命令删除其中的元素,但可以使用del命令删除整个元组对象。

A.   对

B.   错

https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-f303-c01a-2cf5d6189000.html
点击查看答案
23. (多选题)ls = [25, 13, 36, 1]lst = [88]将列表lst中的元素加到列表ls末尾,输出列表[25, 13, 36, 1, 88]的正确的选项有:

A. ls = [25, 13, 36, 1]lst = [88]lsⱣⱤnew = ls + lstprint(lsⱣⱤnew)

B. ls = [25, 13, 36, 1]lst = [88]lsⱣⱤnew = ls.extend(lst)print(lsⱣⱤnew)

C. ls = [25, 13, 36, 1]lst = [88]ls.extend(lst)print(ls)

D. ls = [25, 13, 36, 1]lst = [88]lsⱣⱤnew = ls.extend(lst)print(ls)

https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-e0b5-c01a-2cf5d6189000.html
点击查看答案
73. (单选题)对以上数据,以性别字段作为分组依据,并对分组后的数据重新排序的语法正确的是()

A. frame[['ID']].groupby(frame('gender')).count().sortⱣⱤvalues(by=('gender'))

B. frame[['ID']].groupby(['gender']).count().sortⱣⱤvalues(by=frame['gender'])

C. frame[['ID']].groupby(('gender')).count().sortⱣⱤvalues(by=frame('gender'))

D. frame[['ID']].groupby(frame['gender']).count().sortⱣⱤvalues(by=['gender'])

解析:答案解析:

https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-49eb-c01a-2cf5d6189000.html
点击查看答案
186. (填空题)函数可以有多个参数,参数之间使用( )分隔
https://www.shititong.cn/cha-kan/shiti/000dded1-b61f-2a1e-c01a-2cf5d6189000.html
点击查看答案
98. (单选题)有一个函数关系表如下所示:下面程序段中,能正确表示上面关系的是()

A. y = x + 1if x >= 0:if x == 0:y = xelse:y = x-1

B. y = x - 1if x! = 0:if x > 0:y = x + 1else:y = x

C. if x <= 0:if x < 0:y = x - 1else:y = xelse:y = x+1

D. y = xif x <= 0:if x < 0:y = x - 1else:y = x + 1

https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-7ca9-c01a-2cf5d6189000.html
点击查看答案
79. (单选题)可变参数*args传入函数时的存储方式为( )

A.   列表

B.   元组

C.   字典

D.   数据框

https://www.shititong.cn/cha-kan/shiti/000dded1-b61e-55fb-c01a-2cf5d6189000.html
点击查看答案
18. (多选题)以下列表操作方法中,属于原地操作,无返回值的为:

A. pop()

B. append()

C. remove()

D. clear()

https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-d591-c01a-2cf5d6189000.html
点击查看答案
22. (多选题)ls = [25, 13, 36, 1]ls为一个列表,删除其中元素13,输出列表[25, 36, 1]的正确的选项有:

A. ls = [25, 13, 36, 1]ls.remove(13)print(ls)

B. ls = [25, 13, 36, 1]ls.pop(1)print(ls)

C. ls = [25, 13, 36, 1]ls.clear(13)print(ls)

D. ls = [25, 13, 36, 1]ls=[ls[0]]+ls[2:]print(ls)

https://www.shititong.cn/cha-kan/shiti/000dded1-b61d-dea1-c01a-2cf5d6189000.html
点击查看答案
试题通小程序
试题通app下载