<?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: How to make a loop work? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14125#M1106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/4563" target="_blank"&gt;Duncan Hornby&lt;/A&gt;‌ suggests, for loops are a standard operation in python.&amp;nbsp; I've always said, give me a list to Ioop through and I can change the world...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I'm unclear what it is you need to loop through?&amp;nbsp; In&amp;nbsp;your current for loop through the cursor object, what is the purpose of passing a list as the value?&amp;nbsp; (Line 2&amp;nbsp; below)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Completed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:34:35 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2021-12-10T20:34:35Z</dc:date>
    <item>
      <title>How to make a loop work?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14123#M1104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a survey made from survey 123, I have a point layer representing assets. The goal is to complete the survey for every asset. I&amp;nbsp;have a field in my points layer called CompleteY_N, by default the attribute is 'Not Completed'. I want the attribute to change to 'complete' as a survey it summited and loop through until all assets say complete in the CompleteY_N field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a script that selects by location and&amp;nbsp;then uses U&lt;SPAN&gt;pdateCursor to change the attribute to complete&lt;/SPAN&gt;. I have also used field calculate to change the selected features to complete ( not sure which way is better).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure how to do a loop like this, or if I have even explained what I am trying to do correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my script.&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy

&lt;SPAN style="color: #808080;"&gt;# Input property
&lt;/SPAN&gt;inPropertypntfc = &lt;SPAN style="color: #a5c261;"&gt;r"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\propertypnts"
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;print&lt;/SPAN&gt;(inPropertypntfc)

&lt;SPAN style="color: #808080;"&gt;# input survey feature class
&lt;/SPAN&gt;inSurveyfc = &lt;SPAN style="color: #a5c261;"&gt;r"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\retailpt2"
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;print&lt;/SPAN&gt;(inSurveyfc)

&lt;SPAN style="color: #808080;"&gt;# Make feature layer of feature classes to allow selection
&lt;/SPAN&gt;arcpy.MakeFeatureLayer_management(inPropertypntfc&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Propertypntlyr"&lt;/SPAN&gt;)
arcpy.MakeFeatureLayer_management(inSurveyfc&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Surveylyr"&lt;/SPAN&gt;)


&lt;SPAN style="color: #808080;"&gt;# select intersecting points
&lt;/SPAN&gt;arcpy.SelectLayerByLocation_management(&lt;SPAN style="color: #a5c261;"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;"Surveylyr"&lt;/SPAN&gt;)
&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;"select"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;# Update Cursor for point layer
&lt;/SPAN&gt;cursor = arcpy.da.UpdateCursor(&lt;SPAN style="color: #a5c261;"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;[&lt;SPAN style="color: #a5c261;"&gt;"CompleteY_N"&lt;/SPAN&gt;])
&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;(cursor)
&lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;cursor:
    cursor.updateRow([&lt;SPAN style="color: #a5c261;"&gt;"Completed"&lt;/SPAN&gt;])
&lt;SPAN style="color: #cc7832;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #a5c261;"&gt;"Done"&lt;/SPAN&gt;)

&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;row
&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;cursor&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:34:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14123#M1104</guid>
      <dc:creator>JessicaRamirez1</dc:creator>
      <dc:date>2021-12-10T20:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a loop work?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14124#M1105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried searching the internet on how to loop in python, &lt;A href="https://www.learnpython.org/en/Loops"&gt;here&lt;/A&gt; is one such website?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2019 13:14:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14124#M1105</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2019-08-22T13:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a loop work?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14125#M1106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/4563" target="_blank"&gt;Duncan Hornby&lt;/A&gt;‌ suggests, for loops are a standard operation in python.&amp;nbsp; I've always said, give me a list to Ioop through and I can change the world...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I'm unclear what it is you need to loop through?&amp;nbsp; In&amp;nbsp;your current for loop through the cursor object, what is the purpose of passing a list as the value?&amp;nbsp; (Line 2&amp;nbsp; below)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Completed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14125#M1106</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-10T20:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a loop work?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14126#M1107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote this script based on my understanding of your explanation (Which was a little hazy!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I kept your existing code exactly as it was just moved it into a function, then added one new function, and a Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this helps &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; time


&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;update_database&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# Input property&lt;/SPAN&gt;
    inPropertypntfc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\propertypnts"&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inPropertypntfc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# input survey feature class&lt;/SPAN&gt;
    inSurveyfc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\retailpt2"&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inSurveyfc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Make feature layer of feature classes to allow selection&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inPropertypntfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inSurveyfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Surveylyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


    &lt;SPAN class="comment token"&gt;# select intersecting points&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"INTERSECT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Surveylyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"select"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Update Cursor for point layer&lt;/SPAN&gt;
    cursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CompleteY_N"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Completed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Done"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; row
    &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor
    
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Surveylyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;all_surveys_complete&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    inPropertypntfc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"G:\GIS\ESRI\Staging\Survey123\Testing\New File Geodatabase.gdb\propertypnts"&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Make feature layer of feature classes to allow selection&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inPropertypntfc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Select features that are not complete&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByAttribute_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NEW_SELECTION'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                             &lt;SPAN class="string token"&gt;"""   "CompleteY_N" &amp;lt;&amp;gt; 'Completed'  """&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;#Check if we got a selection&lt;/SPAN&gt;
    desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FIDSet  &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;#If there is no selection, all surveys are complete&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Propertypntlyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;



&lt;SPAN class="comment token"&gt;#Main Script logic&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#Carry on forever (until we "break" the loop)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;#Existing code&lt;/SPAN&gt;
    update_database&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;#Check if all are complete&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; all_surveys_complete&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

        &lt;SPAN class="comment token"&gt;#Exit the while loop&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;#Wait for 10 mins for more surveys to be completed and added to the retailpt2 layer&lt;/SPAN&gt;
    time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sleep&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;600&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"All surveys are complete!"&lt;/SPAN&gt;


&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&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lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14126#M1107</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2021-12-10T20:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a loop work?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14127#M1108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the info&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2019 21:07:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14127#M1108</guid>
      <dc:creator>JessicaRamirez1</dc:creator>
      <dc:date>2019-08-26T21:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a loop work?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14128#M1109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I will try this out!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2019 21:08:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-make-a-loop-work/m-p/14128#M1109</guid>
      <dc:creator>JessicaRamirez1</dc:creator>
      <dc:date>2019-08-26T21:08:35Z</dc:date>
    </item>
  </channel>
</rss>

