Question: Use python You will write a Python program that defines two one-dimensional lists, each with 20 real elements. Use the list constructor bracket to initialize

Use python
You will write a Python program that defines two one-dimensional lists, each with 20 real elements. Use the list constructor bracket to initialize the values of the first list to the following values (you may cut and paste these to save some typing): 2. 0.2802-0. 11030.2584 0.0961 0.4036 0. 36810.4420 0.456o. 07520. 4403 0.26530. 1469 0. 3211 0.48460.4570 0.3311 0. 1491 0. 23170. 14770.0491 Make sure that no line in your program is longer than 80 characters. Remember that the ampersand character allows you to continue a line, but you will not need one to continue a line with an open bracket. Initialize the second list to be empty. Then, use a loop to fill the second list with the sum of all of the values in the first list up to that point. That is, the value in the first element of the second list will be 0.2802, the value of the second element of the second list will be 0.2802 +-0.1103 = 0.1699, and so onq(Hint: The last value in the second list will be -1.3077.) Note that a conditional (an if statement) may be required here. Print out the list elements, one per line using a floating point format that shows 4 digits to the right of the decimal point. Print out the second list from problem 2 above. This time, assume that the list could be any length (your solution should work if the list had other than 20 elements) and figure out how to print 5 elements per line, using the same floating point format shown in the problem above. Using slice notation with a variable as the starting and ending element number will be helpful. 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
