Sunday, 15 May 2011

Please how do i print pairs of X and t in PYTHON? -


Please print the pair of X and T in Python?

X = [8, 10, 1]

T = [10, 8, 1]

Something like

[[ 8, 10], [10, 8], [1, 1]]

(suppose You can not put emphasis on getting lists of lists) You can use:

  list (zip (x, t))  

Result:

  [(8, 10), (10, 8), (1, 1)]  

No comments:

Post a Comment