list search obj with index number
<pre><code>stations = ['Schagen', 'Heerhugowaard', 'Alkmaar', 'Castricum', 'Zaandam', 'Amsterdam Sloterdijk', 'Amsterdam Centraal', 'Amsterdam Amstel', 'Utrecht Centraal', 'âs-Hertogenbosch', 'Eindhoven', 'Weert', 'Roermond', 'Sittard', 'Maastricht']
</code></pre>

<p>I tried this:</p>

<pre><code>print(sations.index[1])
</code></pre>

<p>I cant find a way to print a list item when I search for the index.</p>

<p>If you want to find an object, you can use <code>index()</code>. For example</p>

<pre><code>index = 0
if "Zaandam" in stations:
    index = stations.index("Zaandam")
print(stations[index])
</code></pre>

<p>The index of <code>Zaandam</code> is being logged to the variable <code>index</code> and then it's logged index is being used to <code>print</code> itself. The <code>if</code> statement is simply a wrapper.</p>

python list python-3.x