<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Counting items that go through your loop in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22528#M1742</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct sir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;counter = counter + &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; (counter%&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;1000&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;) == &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; str(counter)&amp;nbsp; + " items processed."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;would be the correct syntax.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards,&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Feb 2015 21:05:54 GMT</pubDate>
    <dc:creator>TomSellsted</dc:creator>
    <dc:date>2015-02-26T21:05:54Z</dc:date>
    <item>
      <title>Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22522#M1736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I dive further into Python, I find myself making a "GIS Module" that calls functions that are useful to my work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a quick find and replace function but i want to print off the total number items replaced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a show unique value function that lists all the unique items in a field and their values.&amp;nbsp; I want to include just a simple line like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;547 items replaced&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here are my 2 functions can anyone explain how to include this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="font-weight: bold;"&gt;field_counter&lt;/SPAN&gt;(table&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;fieldname):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values = [r[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;] &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;r &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;arcpy.da.SearchCursor(table&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;[fieldname])]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unique_values = &lt;SPAN style="color: #8888c6;"&gt;set&lt;/SPAN&gt;(values)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_dict = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;value &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;unique_values:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_dict[value] = values.count(value)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;"{0} Unique Value: {1} has {2} attribute(s)"&lt;/SPAN&gt;.format(fieldname&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;value&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;count_dict[value]))

def find_and_replace(table, field, find, replace):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(table, [field]) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[0] == find:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = replace
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(row[0] + ' was replaced by' + replace)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif row[0] != find:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(row[0] + ' was not replaced')&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22522#M1736</guid>
      <dc:creator>MatthewRusso</dc:creator>
      <dc:date>2021-12-10T20:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22523#M1737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Untested, but should work like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;counter = 0
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;with arcpy.da.UpdateCursor(table, [field]) as cursor:&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; for row in cursor:&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; if row[0] == find&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = replace&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter = counter + 1&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;print counter&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;return counter&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To pass counter back to the calling function, you would 'return counter', but since we don't see where you call the function, it's hard to write it. It would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;count = &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;find_and_replace(table, field, find, replace)&lt;/SPAN&gt;
&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;print count # the number returned by function&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:54:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22523#M1737</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-10T20:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22524#M1738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't realize that it was that easy.... haha.&amp;nbsp; Here I was thinking I needed to do a bunch of stuff in the loop to make this work, Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 18:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22524#M1738</guid>
      <dc:creator>MatthewRusso</dc:creator>
      <dc:date>2015-02-26T18:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22525#M1739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matthew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do iterative counts I calculate the modulo of the desired increment.&amp;nbsp; This can be useful when you have a large dataset and want to see its progress.&amp;nbsp; It would look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;counter = counter + 1
if (counter%1000) == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(counter)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that in order to print an integer you will need to make it a string too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:54:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22525#M1739</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2021-12-10T20:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22526#M1740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Python will print integers just fine without casting it to string. The problem I think you are referring to arises when you try to concatenate strings with integers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(100):
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = count + 1
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print count&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't work:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(100):
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = count + 1
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Count: " + count&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:54:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22526#M1740</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-10T20:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22527#M1741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good information.&amp;nbsp; I still consider myself a Novice at this by I am trying to absorb as much as possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/19932"&gt;Darren Wiens&lt;/A&gt;‌ and Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 20:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22527#M1741</guid>
      <dc:creator>MatthewRusso</dc:creator>
      <dc:date>2015-02-26T20:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22528#M1742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Darren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct sir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;counter = counter + &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; (counter%&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;1000&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;) == &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; str(counter)&amp;nbsp; + " items processed."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;would be the correct syntax.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards,&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 21:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22528#M1742</guid>
      <dc:creator>TomSellsted</dc:creator>
      <dc:date>2015-02-26T21:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Counting items that go through your loop</title>
      <link>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22529#M1743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be better (cleaner) to use &lt;A href="https://mkaz.com/2012/10/10/python-string-format/" rel="nofollow noopener noreferrer" target="_blank"&gt;string &lt;SPAN style="font-family: 'courier new', courier;"&gt;format()&lt;/SPAN&gt;&lt;/A&gt;. Based on the correct answer from &lt;A href="https://community.esri.com/migrated-users/19932" target="_blank"&gt;Darren Wiens&lt;/A&gt;‌, this is what I would do.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;counter = 0
with arcpy.da.UpdateCursor(table, [field]) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row[0] == find:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = replace
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter += 1
print "{} items processed".format(count)
return counter&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/counting-items-that-go-through-your-loop/m-p/22529#M1743</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-10T20:54:55Z</dc:date>
    </item>
  </channel>
</rss>

