# import random
# r= 0
# all = 0
# sf = ['+', '-', '*', '/']
# while 1:
# a = random.randint(0, 10)
# b = random.randint(0, 10)
# s = random.choice(sf)
# if s =='+':
# print(f'{a}+{b}=?')
# da = int(input('答案:'))
# if da==a+b:
# print('答对了')
# r+=1
# all+=1
# elif da ==0:
# break
# else:
# print('打错了')
# all+=1
# elif s=='-':
# print(f'{a}-{b}=?')
# da = int(input('答案:'))
# if da==a-b:
# print('答对了')
# r+&#
Python‘‘‘1.随机生成10以内数字2.随机选择+或-或*或/3.学生查看题目并输入答案4.判断学生答案是否正确5.输入0退出,退出是,统计答题总数,并统计正确数量个正确率(保留两位小数)‘‘‘
于 2022-04-09 11:39:20 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)