Python Object Element Extraction and Addition
<p>I’m sure all experienced Python programmers know a simple, elegant way to do this. Unfortunately, at my beginner’s level, I do not.</p>

<p>Anyway, I’m currently attempting to modify some AI scripts for a game program written by others. I’m looking for a way to extract the numeric elements from an existing object and then add all of those elements together.</p>

<p>The number of elements in the object will vary, but will usually be no more then ten (10).</p>

<p>The elements in the object will always be ‘floats’.</p>

<p>So, for i in obj:</p>

<p>How should I proceed to extract all of the elements from the existing object and then add them together to return a new ‘float’ number?</p>
