Welcome, Guest! Registration

loc2log

Wednesday, 2024-04-17
Main » 2012 » April » 22 » Python read pairwise from list of single elements
3:14 AM
Python read pairwise from list of single elements
Problem: Read items pairwise from list with single elements (planar_list)
from itertools import izip 

planar_list = [1, 2, 3, 4]

for item1, item2 rom izip(*[iter( planar_list )]*2):
    print str(item1) + " " + str(item2)
See Pairs from single list - http://stackoverflow.com/questions/4628290/pairs-from-single-list for details.
Views: 1482 | Added by: loc2logg | Tags: Python | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Registration | Login ]