第26018题 单选题
Python统计日志错误出现次数程序的空白填空

待填程序如下:

log = input("请输入日志文件内容:")
# 如输入:SyntaxError TypeError SyntaxError IndexError
error_count = {}
errors = log.split()
for error in errors:
    if error in error_count:
        _______________ # 填写代码 ①
    else:
        _______________ # 填写代码 ②
print("日志中每种错误出现的次数如下:")
for error, count in error_count.items():
    print(f"{error}: {count}")
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析