题库首页 › 青少年软件编程(Python) › 题目 17270

阿宝打算用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 and t =35: print('高温')

正确答案:C

试卷来源:202512 青少年软件编程等级考试Python二级真题

本卷相关题目

在线做题 同科目题库