mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	zip() returns an iterator, make a list() of it; thanks to Martin from docs@
This commit is contained in:
		
							parent
							
								
									fbd4f80979
								
							
						
					
					
						commit
						0a90a82b8a
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -292,7 +292,7 @@ which, in turn, is the same as::
 | 
			
		|||
In the real world, you should prefer built-in functions to complex flow statements.
 | 
			
		||||
The :func:`zip` function would do a great job for this use case::
 | 
			
		||||
 | 
			
		||||
   >>> zip(*matrix)
 | 
			
		||||
   >>> list(zip(*matrix))
 | 
			
		||||
   [(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]
 | 
			
		||||
 | 
			
		||||
See :ref:`tut-unpacking-arguments` for details on the asterisk in this line.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue