Question
This cell is followed by another Markdown cell with the following content. Define a function add_reverse() that takes a list of numbers and returns Note
This cell is followed by another Markdown cell with the following content. Define a function add_reverse() that takes a list of numbers and returns Note that the name of the function is in monospace font. (Use back quotes.) The next cell is a code cell in which you define function add_reverse(). It is passed a list of numbers and returns the list of numbers obtained by adding to each element in the input list the element in the corresponding position of the reversed version of this list. For example, if the input list is [1, 0, 5, 3], then the reversed version is [3, 5, 0, 1], and what is returned by the function is [4, 5, 6, 4]. (Use function reversed() to reverse the list.) The next cell is a Markdown cell whose content is Call add_reverse(), passing the list [2,0,5,1]. Assign the returned value to res. The name of the function, the list, and the name of the variable are all in monospace font. The next cell contains the code accomplishing this and shows the value for res. (Have res on a line by itself at the end of the cell.) This is followed by a Markdown cell with content Find the sum of the values in res. Again, the name of the variable is in monospace font. The last cell is a code cell that finds the sum of the elements of res. Use sum().
Problem 2 (3 points) Produce a Python 3 Jupyter notebook The 1st cell (a Markdown cell) renders as in the following screenshot COMP 361 & 651 Data Analytics This is the second part of Assignment 2. Purpose This is to give you familiarity with Jupyter. 1 This cell is followed by another Markdown cell with the following content. Define a function add reverse () that takes a list of numbers and returns Note that the name of the function is in monospace font. (Use back quotes.) 1 The next cell is a code cell in which you define function add_reverse () It is passed a list of numbers It returns the list of numbers obtained by adding to each element in the input list the element in the corresponding position of the reversed version of this list E.g., if the input list is [1, 0, 5, 3], athen the reversed version is [3, 5, 0, 1], and what is returned by the function is [4, 5, 6, 4] . 1 1 Use function reversed() to reverse the list The next cell is a Markdown cell whose content is Call add_reverse (), passing the list [2,0,5,1]. Assign the returned value to res. The name of the function, the list, and the name of the variable are all in monospace font The next cell contains the code accomplishing this It also shows the value for res Have res on a line by itself at the end of the cell This is followed by a Markdown cell with content Find the sum of the values in res. Again, the name of the variable is in monospace font The last cell is a code cell that finds the sum of the elements of res o Use sum()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started