我一直在用Python 3.3编写一个基础计算器,希望能在命令窗口中运行它。
然而,当我到最后时,它会在我来得及查看最终答案之前关闭窗口。
所以,我想知道是否有等价于C++ System ('PAUSE') 命令的方法,让它在用户准备好之前不再继续运行。
这是我的计算器代码:
print('Your Very Own Basic Calculator')
first_num = int(input('Please Enter The First Number: '))
second_num = int(input('Please Enter The Second Number: '))
Equation = input('What would you like to do, multiplication, division, subtraction or
if Equation == ('*'):
addition? *, /, -, +')
print('The Answer is',first_num * second_num)
elif Equation == ("/"):
print('The Answer is',first_num / second_num)
elif Equation == ('-'):
print('The Answer is',first_num - second_num)
elif Equation == ('+'):
print('The Answer is',first_num + second_num)
thanks