x1, y1, a1, b1, x2, y2 = int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
Run Code Online (Sandbox Code Playgroud)
我的问题是在新行上读取每个给出的6个数字.如何比上面的代码更简洁地做到这一点?
x1, y1, a1, b1, x2, y2 = (int(input()) for _ in range(6))
Run Code Online (Sandbox Code Playgroud)
更换range用xrange和input用raw_input在Python 2.