<jupyter_start><jupyter_text>Symmetrical Sum Instructions to Students- **Do not add or remove cells in this notebook. Do not edit or remove the ` START FUNCTION` or ` END FUNCTION` comments. Do not add any code outside of the functions you are required to edit. Doing any of this will lead to a mark of 0%!**- Answer the questions according to the specifications provided.- Use the given cell in each question to to see if your function matches the expected outputs.- Do not hard-code answers to the questions.- The use of stackoverflow, google, and other online tools are permitted. However, copying fellow student's code is not permissible and is considered a breach of the Honour code below. Doing this will result in a mark of 0%.- Good luck, and may the force be with you! Honour CodeI **YOUR NAME, YOUR SURNAME**, confirm - by submitting this document - that the solutions in this notebook are a result of my own work and that I abide by the   EDSA Student Manifesto.Non-compliance with the honour code constitutes a material breach of contract. Challenge**Finding the Sum of a Symmetrical Sub-List****Task:** Create a function called symmetrical_sum which takes a Python list of integers as input and searches for a 'symmetrical' inner-portion of the list. Here symmetry is said to occur if the value of the  ith  element from the start of the list is equal to the value of the  ith  value from the end of the list. The inner-portion then consists of all elements between and including these equal values. If found, the function returns both the symmetrical part of the list, as well as the sum of its constituent elements as a tuple.Function arguments: lst - a Python list containing elements of type int. Note: len(lst)  ≥0 Returns: A Python tuple of the form ([symmetrical-portion], sum-of-symmetrical-portion)**Example:** symmetrical_sum([10,8,7,5,9,8,15]) == ([8, 7, 5, 9, 8], 37). Here a symmetrical portion of the list is formed by the elements at the second and second-last index, which share a value of 8. The function returns this symmetrical portion, as well as its sum of 37 within a a single tuple.<jupyter_code>### START FUNCTION
def symmetrical_sum(a):
    if len(a)==0:
        result=(a,0)
    elif len(a) == 1:
        result=(a,(a[0]))
    else:
        for ab in range(len(a)):
            if a[ab]==a[-(ab+1)]:
                if ab == 0:
                    new_list=a                
                    sum_s=sum(a)                
                    result=(new_list,sum_s)
                    break
                else:
                    new_list=a[ab: -ab]                
                    sum_s=sum(a[ab :-ab])                
                    result=(new_list,sum_s)
                    # your code here
                    break
    return result
### END FUNCTION

symmetrical_sum([])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07130373995106606, 'fraction_numerical': 0.009786787836420832, 'mean_word_length': 2.7072538860103625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '28427', 'license': 'MIT', 'n_tokens_mistral': 778, 'n_tokens_neox': 715, 'n_words': 385, 'path': 'Explore Assignments/Done/user_symmetrical_sum_student_version.ipynb', 'repo_name': 'George-Kibe/Data-Science', 'size': '2861'}