女朋友的编程作业,适合零基础的同学。 题目 思路 运算是简单的数学竖式,计算并没有困难,题目考察点在于python的格式化输出。 python中的格式化输出主要使用format方法。 实现代码(固定长度) print('请输入两个整数:') ## 输出 a = int(input()) ## 输入 b = int(input()) ## 输入 while(1): print('请输入两个整数的运算方式(+或-):') ## 输出 y = input() ## 输入 if y=='+': c = a+b else: c = a-