我想知道如何从STDIN中读取它并将其存储到两个数字变量中。谢谢
10
20
-Rik
答案 0 :(得分:1)
在python2.7 +中:
x=int(raw_input()) #Terminal will stall to allow user to input the first number
y=int(raw_input()) #This will wait for the second number to be inputted
在python3中:
x=int(input()) #Terminal will stall to allow user to input the first number
y=int(input()) #This will wait for the second number to be inputted