Adding the sum of three digits
<p>So I am writting a program that inputs a 3 # digit and breaks it apart. I am having trouble figuring out how to then add the separate digits altogether?</p>

<p>For example: The user inputs 345</p>

<p>My program will break the #'s apart to 3,4,5 but how do I then add those numbers together?</p>

<p>this is my code thus far,  </p>

<pre><code>#set variable
val = raw_input("Type your three digit number please: ")


print 'The first digit is {}'.format(val[0])
print 'The second digit is {}'.format(val[1])
print 'The third digit is {}'.format(val[2])


#set variable
total = [val[0] +val [1] + val[2]]
total_value = total

print 'The sum of the three digits is' total_value
</code></pre>
