题目内容 (请给出正确答案)
[单选题]

对于如下代码说法正确的是() def changeList(xList): i = 0 for e in xList: xList[i] += 1 i += 1 xList = [1, 2, 3] changeList(xList) print(xList)

A.因为函数内部不能修改变量的值,所以代码输出: [1, 2, 3]

B.因为函数内部不能修改变量的值,所以代码输出: 1, 2, 3

C.xList是可变对象,该函数修改了xList变量存储的值,所以代码输出:[2, 3, 4]

D.xList是可变对象,该函数修了了xList所指向列表的内容,所以代码输出:[2, 3, 4]

提问人:网友rvampire 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有3位网友选择 B,占比33.33%
  • · 有3位网友选择 C,占比33.33%
  • · 有2位网友选择 A,占比22.22%
  • · 有1位网友选择 D,占比11.11%
匿名网友 选择了B
[100.***.***.116] 1天前
匿名网友 选择了B
[58.***.***.232] 1天前
匿名网友 选择了C
[145.***.***.68] 1天前
匿名网友 选择了C
[171.***.***.181] 1天前
匿名网友 选择了D
[65.***.***.189] 1天前
匿名网友 选择了A
[168.***.***.183] 1天前
匿名网友 选择了A
[177.***.***.16] 1天前
匿名网友 选择了B
[59.***.***.65] 1天前
匿名网友 选择了C
[81.***.***.36] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“对于如下代码说法正确的是() def changeList(…”相关的问题
第1题

【简答题】Passage 1: Television changed my life forever. We stopped eating dinner at the dinning-room table after my mother found out about TV trays. We kept the TV trays behind the kitchen door and served ourselves from pots on the stove. Setting and clearing the dinning-room table used to be my job; setting and clearing meant unfolding and wiping our TV trays, then, when we’d finished, wiping and folding our TV trays. Dinner was served in time for one program and finished in time for another. During dinner we used to talk to one another. Now television talked to us. If you had something you absolutely had to say, you waited until the commercial, which is, I suspect, where I learned to speak in thirty-second bursts. As a future writer, it was good practice in editing my thoughts. As a little girl, it was lonely as hell. Once in a while, I’d pass our dinning-room table and stop, thinking I heard our ghosts sitting around talking to one another, saying stuff. Thesis: ________________________________________________________________________ Passage 2: People interrupt for various reasons. One is believing that what they have to say is more important than what the other person is saying. Another reason people interrupt is that they believe they know what the other person is going to say and want the person to know that they already know. People may also interrupt when they are not paying close attention. The interruption communicates a lack of sensitivity, a superior attitude, or both. People need to be able to verbalize their ideas and feelings fully; inappropriate interruptions are bound to damage their self-concepts or make them hostile – and possibly both. Simply stated, whatever you have to say is seldom so important that it requires you to interrupt a person. When you do interrupt, you should realize that you may be perceived as putting a person down. The more frequent the interruptions, the greater the potential harm. Thesis: ________________________________________________________________________

点击查看答案
第2题
Queste sono le tue foto in Italia? ( ) fai vedere?
点击查看答案
第3题
Choose the best statement that serves in an opening paragraph in an essay on reducing pollution.

A、For example, if we impose ban on plastic bags, the white pollution will be thus decreased.

B、From the stories mentioned we can see the harm of pollution.

C、Nowadays, more and more people begin to be aware of the significance of reducing pollution.

D、On a personal level, driving and flying less will reduce air pollution.

点击查看答案
第4题
下述命令可以更改图形对象属性的有( )。

A、CHANGE

B、ZOOM

C、特性匹配

D、PROPERTIES

E、MATCH

点击查看答案
第5题
对于如下代码说法正确的是:( ) x = 5 def foo(x): x += 1 xList.append("a") yList = [] print(x, xList) foo(x)

A、以下代码运行时出错,因为没有将xList传入到foo函数内

B、x是局部变量, xList是全局变量, yList是全局变量

C、x是全局变量, xList是局部变量, yList是局部变量

D、x是局部变量, xList是全局变量, yList是局部变量

点击查看答案
第6题
对于如下代码,以下说法正确的是:( ) def foo(): x = 1 xList.append("a") xList = ["b", "c"] x = 5 foo(x, xList)

A、执行完foo(x, xList)后x的值等于1,xList的值等于["b", "c", "a"]

B、执行完foo(x, xList)后x的值等于5,xList的值等于["b", "c", "a"]

C、执行完foo(x, xList)后x的值等于1,xList的值等于["b", "c"]

D、执行完foo(x, xList)后x的值等于5,xList的值等于["b", "c"]

点击查看答案
第7题
以下说法正确的是:( ) def f1(x): return x+1 def f2(): return None def f3(x): print(x) def f4(): return 1,2

A、f1与f4返回的值的类型一样

B、f2返回了None,f3没有任何返回值

C、f1,f2,f3,f4都有返回值

D、f4返回了一个元组

点击查看答案
第8题
以下说法正确的是( ) def f1(): return 1 def f2(): return 1

A、x = f1()可以正确执行,x = f1不能正确执行

B、f1与f2类型是一样的

C、f1()与f2()都是函数对象

D、依次执行: x = f1 y = f1 这时候x与y指向的是同一个对象

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信