for loop arcpy

5725
2
Jump to solution
04-04-2016 01:19 AM
jayasudha
Emerging Contributor

Hi,

Please explain the following line from ArcGIS documentation for python. It looks different from regular for loop which ends with colon. 

values = [row[0] for row in arcpy.da.SearchCursor(fc, (field))]

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

it is a 'list comprehensions' 

List comprehensions 3 ... and there are two others.

official docs in all python versions

5. Data Structures — Python 3.4.4 documentation

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

it is a 'list comprehensions' 

List comprehensions 3 ... and there are two others.

official docs in all python versions

5. Data Structures — Python 3.4.4 documentation

jayasudha
Emerging Contributor

Thanks for the help

0 Kudos