Python TypeError Math
<p>I used this code:</p>

<pre><code>import pywapi
import string

weather_com_result = pywapi.get_weather_from_weather_com('33020')

temp_f = 'temperature' * 9/5 + 32
print (weather_com_result['current_conditions']['text'].lower() + weather_com_result['current_conditions'][temp_f])
</code></pre>

<p>And then when I run, I get:</p>

<pre><code>Traceback (most recent call last):
File "weather.py", line 6, in &lt;module&gt;
temp_f = 'temperature' * 9/5 + 32 
TypeError: unsupported operand type(s) for /: 'str' and 'int'
</code></pre>

<p>Does anyone know what Im doing wrong?</p>

<p>You are trying to do arithmetic operations between a string and a number. <code>'temperature' * 9/5</code></p>

<p>You need to get your temperature as a number first. 
I see you are using <code>pywapi</code> lib. So, you can get the current temperature looking up like this <code>weather_com_result['current_conditions']['temperature']</code> and casting it to int. </p>

<pre><code>temperature = int(weather_com_result['current_conditions']['temperature'])
temp_f = temperature * 9/5 + 32
</code></pre>

python