📜  如何在 python 代码示例中创建计算器

📅  最后修改于: 2022-03-11 14:46:25.655000             🧑  作者: Mango

代码示例2
print('Calculator')
input_1 = input('First Number? ')
input_2 = input('Second Number? ')

try:
    print(f'{input_1} + {input_2} is {float(input_1) + float(input_2)}')
    print(f'{input_1} - {input_2} is {float(input_1) - float(input_2)}') 
    print(f'{input_1} X {input_2} is {float(input_1) * float(input_2)}')
    print(f'{input_1} / {input_2} is {float(input_1) // float(input_2)}')
except Exception as e:
    print(f'ERROR: {e}')