如何在python中方便地读取数字?

nht*_*rnm 4 python

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个数字.如何比上面的代码更简洁地做到这一点?

Fre*_*Foo 8

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.