title: Converting tuple to integer
body: <p>I have this python function that takes 2 arguments (<em>string , dictionary</em>) and returns a float. The function is designed to take the average of the integers within a dicionary of scores and strings.</p>
  
  <pre><code>def happiness_score(string, dic):
     keys = string.lower().split()
     v = sum(dic[key] for key in keys)
     return float(v)/len(keys)
  </code></pre>
  
  <p>I have this test case which works:</p>
  
  <pre><code>print happiness_score("a b" , {"a":(1.2) , "b":(3.4)})
  &gt;&gt;&gt; 2.3
  </code></pre>
  
  <p>I also have a test case with tuples:</p>
  
  <pre><code>print happiness_score("a b" , {"a":(1,2) , "b":(3,4)})
  </code></pre>
  
  <p>How can I change my code so that I can convert any given tuple to integer so that I can still run my program?</p>