<?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: Python: Retrieve Items From List in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41158#M3284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Length of list&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;len(listing)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Get index starts at zero, so for your example&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;listing = [2,4,6,8]&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;To get 6 you would do&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;listing[2]&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Nov 2011 13:29:15 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2011-11-01T13:29:15Z</dc:date>
    <item>
      <title>Python: Retrieve Items From List</title>
      <link>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41157#M3283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm struggling with solving the problem described in this thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/39912-looped-block-selections"&gt;http://forums.arcgis.com/threads/39912-looped-block-selections&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started a new thread because I have questions specifically related to lists in python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lets say my list is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;list = [2,4,6,8]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to be able to do 2 things which I thought should be fairly simple:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Get the total number of items in the list (4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Get the value of a list item at a specific index (eg. return 6 for index value 3 - or 2 if the index starts at 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The methods listed here: &lt;/SPAN&gt;&lt;A href="http://docs.python.org/tutorial/datastructures.html"&gt;http://docs.python.org/tutorial/datastructures.html&lt;/A&gt;&lt;SPAN&gt; don't seem to do either of those things.&amp;nbsp; Is there some alternate method or object that would allow me to do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 13:24:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41157#M3283</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2011-11-01T13:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Retrieve Items From List</title>
      <link>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41158#M3284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Length of list&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;len(listing)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Get index starts at zero, so for your example&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;listing = [2,4,6,8]&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;To get 6 you would do&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;listing[2]&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 13:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41158#M3284</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-11-01T13:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Retrieve Items From List</title>
      <link>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41159#M3285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank-you!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 13:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-retrieve-items-from-list/m-p/41159#M3285</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2011-11-01T13:31:16Z</dc:date>
    </item>
  </channel>
</rss>

