万卷网 > 题目详情
题型:单选题

执行以下代码后,最终字典info的值是?( )

info = {'fruit': 'apple', 'price': 5, 'color': 'red'}
info['price'] = 6 
info['weight'] = 0.3
A.

{'fruit': 'apple', 'price': 5, 'color': 'red', 'weight': 0.3}

B.

{'fruit': 'apple', 'price': 6, 'color': 'red'}

C.

{'fruit': 'apple', 'price': 6, 'color': 'red', 'weight': 0.3}

D.

{'fruit': 'apple', 'price': 5, 'color': 'red'}

更新时间:2026-01-16 10:07:47 |
【知识点】 电子学会Python二级

相似题推荐

单选题

执行代码x=3if x>5:    print("大")else:    print("小")输出的结果是?( )

A.

 大

B.

 小

C.

 无输出

D.

 报错

2026-07-25
单选题

下列哪个不是 Python 中流程控制的关键字?( )

A.

 if

B.

 elif

C.

 print

D.

 else

2026-07-25
单选题

已知列表s = ["a","b","c"],想要在列表开头插入元素 "z",正确语句是?( )

A.

 s.insert (0,"z")

B.

 s.insert (1,"z")

C.

 s.insert (2,"z")

D.

 s.insert (3,"z")

2026-07-25
单选题

林辰有一个存储歌曲名的列表song。最近他用听歌识曲识别到一首新歌《快乐小马》,想将其添加到列表末尾,下列哪个语句可以实现?( )

A.

 song.insert('《快乐小马》')

B.

 song.append('《快乐小马》')

C.

 song.insert(《快乐小马》)

D.

 song.append(《快乐小马》)

2026-07-25
判断题

当程序执行到break语句时,所有的循环都会中断。( )

A.正确 B.错误
2026-07-25
公众号
客服 反馈
顶部