2025年12月电子学会青少年软件编程(Python二级)等级考试试卷
客观题
二级
2025
2026-01-15 12:44:08
102次
2025年12月电子学会青少年软件编程(Python二级)等级考试试卷
客观题
二级
2025
2026-01-15 12:44:08
102次
一、单选题
1.
阿宝打算用Python程序为他的温控装置写控制程序,当温度t≥35为“高温”,t≤18为“寒冷”,其他为舒适。以下哪个程序是错误的?( )
A.t=int(input())
if t >= 35:
print("高温")
elif t >18:
print("舒适")
else:
print("寒冷") |
B.t=int(input())
if t <=18:
print("寒冷")
elif t <35:
print("舒适")
else:
print("高温") |
C.t=int(input())
if t <=18:
print("寒冷")
elif t <=35:
print("舒适")
else:
print("高温") |
D.t=int(input())
if t <=18:
print("寒冷")
if t>18 and t<35:
print('舒适')
if t>=35:
print('高温') |
【知识点】 电子学会Python二级
14.
执行以下代码后,最终字典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'} |
【知识点】 电子学会Python二级
