Chopping a large number into its digits then adding them in Python
<p>I am trying to make a program where whatever a number is entered by the user, the digits composing that number are added, and if they sum to 10, it is good, if not then they've done something wrong. This should be simple I suppose. Though I'm struggling to add together the numbers after I split them. Do you know what I have to do?</p>

<p>This is my attempt:</p>

<pre><code>    num=raw_input("input number?")
num.split() = a
if sum(a) == 10:
  print num + "is a valid number."
else:
  print num + "is invalid!"
</code></pre>

<p>Thank you.</p>
