|
Answer» The following codes have been written using PYTHON. 
We import a module, [NumPy - Numerical Python], so as to convert the upcoming lists into arrays, and then add them. Addition in lists isn't the same as addition in arrays. In lists, when two lists are joined by the '+' operator, both the lists become one single list. Whereas in arrays, when two arrays [converted from lists] are joined by the '+' operator, the elements in them are added up. Once we import the module to perform this task, we define a function using which is used to create user-defined functions. We assign 'n' to an EMPTY list, to represent the final list with the sum. We CHECK for the equality in number of elements for both the lists using a CONDITIONAL STATEMENT and then perform the conversion into arrays, to add the elements. We assign the final list back into 'n' and print it in list form.
|