<jupyter_start><jupyter_text>Exercise 06.1 (selecting and passing data structures)The task in Exercise 04 for computing the area of a triangle involved a function with six arguments ($x$ and $y$ components of each vertex). With six arguments, the likelihood of a user passing arguments in the wrong order is high. Use an appropriate data structure, e.g. a `list`, `tuple`, `dict`, etc,  to develop a new version of the function with a simpler interface (the interface is the arguments that are passed to the function). Add appropriate checks inside your function to validate the input data.<jupyter_code># YOUR CODE HERE
raise NotImplementedError()<jupyter_output><empty_output><jupyter_text>Exercise 06.2 (selecting data structures)For a simple (non-intersecting) polygon with $n$ vertices, $(x_0, y_0)$, $(x_1, y_1)$, . . , $(x_{n-1}, y_{n-1})$, the area $A$ is given by$$A = \left| \frac{1}{2} \sum_{i=0}^{n-1} \left(x_{i} y _{i+1} - x_{i+1} y_{i} \right) \right|$$and where $(x_n, y_n) = (x_0, y_0)$. The vertices should be ordered as you move around the polygon.Write a function that computes the area of a simple polygon with an arbitrary number of vertices. Test your function for some simple shapes. Pay careful attention to the range of any loops.<jupyter_code># YOUR CODE HERE
raise NotImplementedError()<jupyter_output><empty_output><jupyter_text>Exercise 06.3 (indexing)Write a function that uses list indexing to add two vectors of arbitrary length, and returns the new vector. Include a check that the vector sizes match, and print a warning message if there is a size mismatch. The more error information you provide, the easier it would be for someone using your function to debug their code.Add some tests of your code. Hint: You can create a list of zeros of length `n` by    z = [0]*n     Optional (advanced) Try writing a one-line version of this operation using list comprehension and the built-in function [`zip`](https://docs.python.org/3/library/functions.htmlzip).<jupyter_code>def sum_vector(x, y):
    "Return sum of two vectors"
    # YOUR CODE HERE
    raise NotImplementedError()
a = [0, 4.3, -5, 7]
b = [-2, 7, -15, 1]
c = sum_vector(a, b)
assert c == [-2, 11.3, -20, 8]<jupyter_output><empty_output><jupyter_text>Extension: list comprehension<jupyter_code># YOUR CODE HERE
raise NotImplementedError()<jupyter_output><empty_output><jupyter_text>Exercise 06.4 (dictionaries)Create a dictionary that maps college names (the key) to college abbreviations for at least 5 colleges(you can find abbreviations at https://en.wikipedia.org/wiki/Colleges_of_the_University_of_CambridgeColleges).From the dictionary, produce and print1. A dictionary from college abbreviation to name; and1. A list of college abbreviations sorted into alphabetical order.*Optional extension:* Create a dictionary that maps college names (the key) to dictionaries of:- College abbreviation- Year of foundation - Total number students for at least 5 colleges. Take the data from https://en.wikipedia.org/wiki/Colleges_of_the_University_of_CambridgeColleges. Using this dictionary, 1. Find the college with the greatest number of students and print the abbreviation; and 2. Find the oldest college, and print the number of students and the abbreviation for this college.<jupyter_code># YOUR CODE HERE
raise NotImplementedError()<jupyter_output><empty_output><jupyter_text>Optional extension<jupyter_code># YOUR CODE HERE
raise NotImplementedError()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08740655549166187, 'fraction_numerical': 0.015238642898217367, 'mean_word_length': 5.371794871794871, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 3, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '391029', 'license': 'MIT', 'n_tokens_mistral': 1053, 'n_tokens_neox': 983, 'n_words': 439, 'path': 'Assignment/06 Exercises.ipynb', 'repo_name': 'reddyprasade/PYTHON-BASIC-FOR-ALL', 'size': '3478'}