为什么在下面的代码中是x
和y
字符串而不是in?
(注意:在Python2.x中使用raw_input()
。在Python3.x中使用input()
。在Python3.x中将raw_input()
重命名为input()
)
play = True
while play:
x = input("Enter a number: ")
y = input("Enter a number: ")
print(x + y)
print(x - y)
print(x * y)
print(x / y)
print(x % y)
if input("Play again? ") == "no":
play = False
https://stackoverflow.com/questions/20449427
复制相似问题