Python 随机数加法游戏:测试你的运算能力
import random
num1 = random.randint(1, 100) num2 = random.randint(1, 100)
sum = num1 + num2
answer = int(input('请计算' + str(num1) + ' + ' + str(num2) + '的和:'))
if answer == sum: print('计算正确') else: print('计算错误')
原文地址: https://www.cveoy.top/t/topic/oCFW 著作权归作者所有。请勿转载和采集!