📜  python 计算器 - Python 代码示例

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

代码示例6
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}')