交规扣分问答自动判分程序
类型:程序题

题目说明

图片

图片

rule_dict = {}
with open("/data/jgfs.txt") as f:
    data =        ①        .strip()
    while data:
        rule , score = data.split()
        rule_dict[rule] = score
        data = f.readline().strip()
s = 0
for i in rule_dict.keys():
    num =input("题目:"+i + "扣几分?\n请输入答案:")
    if        ②        :
        print("回答正确")
               ③
    else:
        print("回答错误,正确答案是" +        ④        )
print("你的成绩是:" + str(s) + "满分为:" + str(       ⑤        ))

评分标准

(1)f.readline();(2分) (2)rule_dict[i] == num;(2分) (3)s += 1;(2分) (4)rule_dict[i];(2分) (5)len(rule_dict)。(2分)

代码编辑器 加载中...
留空使用题目默认限制
{{resultStatus.text}}
正在加载运行记录...
乐编题库AI助手
人工客服
微信扫码联系客服
历史对话
{{ s.title || '未命名对话' }}
{{ s.created_at }}
暂无历史对话
我能帮助你什么?