Search for a symmetrical inner portion of a list
The code in the question is not working as intended.



  Symmetry occurs if the value of the ith element at the start of the list is equal to the value of the 
  ith element at the end of the list


Meaning for any list l the symmetry occurs when l[i] == l[~i].

&gt;&gt;&gt; symmetrical_sum([1, 2, 1, 3, 4])
([1, 2, 1], 4)
&gt;&gt;&gt; symmetrical_sum([0, 1, 2, 1, 3, 4])
([1, 2, 1], 4)


This says that the midpoint is the same distance from the end of the list as the starting value. And it says 1 and -3 are the same distance.
No where does it say the input will only have one duplicate.

&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 4, 2, 1])
ValueError: 21 is not in list
&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 4, 1, 2])
ValueError: 12 is not in list
&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 1, 4, 2])
ValueError: 12 is not in list

The output returns different amount of values when the size of the input are different multiples of two.

&gt;&gt;&gt; symmetrical_sum([1, 2])
([1], 1)
&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 4])
([2, 3], 2)
&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 4, 5, 6])
([3], 3)
&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 4, 5, 6, 7, 8])
([4, 5], 4)
&gt;&gt;&gt; symmetrical_sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
([5], 5)