<?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: Phyton statement if/else - string/double in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725630#M56224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahhh good... at least the thread is closed&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jan 2016 07:34:21 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-01-15T07:34:21Z</dc:date>
    <item>
      <title>Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725625#M56219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I stuck with simple expression in field calculator in ArcGis. I hope you`ll help me. The picture below contain two fields "Zal" (Double) and "W_zal" (string). I would like to fill field "W_zal" based on "Zal". For example: if Zal &amp;gt; 10, W_zal is 'text', if Zal &amp;lt; 10 , W_zal is "text_2". I`dont know whats is wrong, brackets, spacing... I`ll be grateful for yours help.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Phyton.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/155609_Phyton.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Dec 2015 08:31:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725625#M56219</guid>
      <dc:creator>BartoszBrzeziński1</dc:creator>
      <dc:date>2015-12-13T08:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725626#M56220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select the python parser&lt;/P&gt;&lt;P&gt;and use this as the expression in the code block.&amp;nbsp; I have written the example verbosely so you can follow the logic.&amp;nbsp; It is always best to assign the required output and return the final value after the fact to ensure that all is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def convert(val,fld):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if fld &amp;gt; 10:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = "text"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = "text2"
&amp;nbsp;&amp;nbsp;&amp;nbsp; return val&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this in the expression box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;convert(2, !Zval!)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is an example using a slightly different example... but the principle is the same.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="155244" alt="Field_calc_demo_01.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/155244_Field_calc_demo_01.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:01:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725626#M56220</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T07:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725627#M56221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Dec 2015 14:23:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725627#M56221</guid>
      <dc:creator>BartoszBrzeziński1</dc:creator>
      <dc:date>2015-12-13T14:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725628#M56222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps you could mark this as Answered since the information Dan provides is spot on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Dec 2015 17:15:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725628#M56222</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2015-12-13T17:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725629#M56223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe... I think Bartosz is long gone... it get randomly bumped up the pile over time though&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 07:27:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725629#M56223</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-15T07:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725630#M56224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahhh good... at least the thread is closed&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 07:34:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725630#M56224</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-15T07:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725631#M56225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But awarding the answer to yourself is a bit....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 07:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725631#M56225</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-01-15T07:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725632#M56226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't... Bartosz thought his thank you was the correct answer... perhaps the final closure is solution enough &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 07:39:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725632#M56226</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-15T07:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725633#M56227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;Sorry for that mistake.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 07:42:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725633#M56227</guid>
      <dc:creator>BartoszBrzeziński1</dc:creator>
      <dc:date>2016-01-15T07:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Phyton statement if/else - string/double</title>
      <link>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725634#M56228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&amp;nbsp; Its ok... the question has been getting bumped up randomly over time.&amp;nbsp; At least it is closed now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jan 2016 07:46:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/phyton-statement-if-else-string-double/m-p/725634#M56228</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-15T07:46:13Z</dc:date>
    </item>
  </channel>
</rss>

