python哪错了?求大师指导

T001 2024-08-07 17:24:40 17

n = input().split() a = int(n[0]) b = int(n[1]) num1 = a + b num2 = a - b num3 = a * b num4 = a // b num5=a%b print('{} + {} = {}'.format(a, b, num1)) print('{} - {} = {}'.format(a, b, num2)) print('{} * {} = {}'.format(a, b, num3)) print('{} / {} = {}...{}'.format(a, b, num4,num5))

{{ vote && vote.total.up }}

共 2 条回复

root 站长
n = input().split()
a = int(n[0])
b = int(n[1])
num1 = a + b
num2 = a - b
num3 = a * b
num4 = a // b
num5=a%b
print('{}+{}={}'.format(a, b, num1))
print('{}-{}={}'.format(a, b, num2))
print('{}*{}={}'.format(a, b, num3))
print('{}/{}={}...{}'.format(a, b, num4,num5))
root 站长

输出多了个空格