how to pass elements in a list to a function in a for-loop
<p>I'm trying to print the pressure of each city.  </p>

<p>Instead of using the cities in the list, it is returning the pressure of a city called 'city'. </p>

<p>Super new to this and can't find an answer to something this specific.  thanks!!!!!!</p>

<pre><code>import pyowm
owm = pyowm.OWM('eb68e3b0c908251771e67882d7a8ddff')

city = ["tokyo", "jakarta"]

for i in city:
    city = owm.weather_at_place('city')
    city = city.get_weather()
    print (city.get_pressure()['press'])
</code></pre>

<p>Hanley, I hope you don't mind I rewrote your code.</p>

<pre><code>import pyowm
owm = pyowm.OWM('eb68e3b0c908251771e67882d7a8ddff')

cities = ["tokyo", "jakarta"]

for city in cities:
    city_weather = owm.weather_at_place(city)
    weather = city_weather.get_weather()
    print(weather.get_pressure()['press'])
</code></pre>

python for-loop