Question: PYTHON 3 PLEASE 2. You will write a Python program that defines two one-dimensional lists. Use the list constructor bracket to initialize the values of

 PYTHON 3 PLEASE 2. You will write a Python program that

PYTHON 3 PLEASE

2. You will write a Python program that defines two one-dimensional lists. 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): 0.2802 -0.1103 -0.2584 -0.0961 -0.4036 -0.3681 0.4420 0.4561 0.0752 -0.4403 -0.2653 -0.1469 0.3211 -0.4846 -0.4570 -0.3311 0.1491 0.2317 0 .1477 -0.0491 Make sure that no line in your program is longer than 80 characters. Remember that the backslash 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 on. (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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!