Construct a list by itertools in Python

import itertools
test  =  [[ - 1 ,  - 2 ], [ 30 , 40 ], [ 25 , 35 ]]   
print ( list ( itertools . chain . from_iterable ( test )))

# -> [-1, -2, 30, 40, 25, 35]


Post a Comment

Featured Post

Updated Coupons / promo codes for Google Apps for Work / Business

To redeem: 1. Sign up for Google Apps   2. Go to your billing settings  3. Choose your payment plan  4. Enter your promo code ...