Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will write a Python (PythonWin 3.7.0) program that defines two one-dimensional lists, each with 20 real elements. Use the list constructor bracket to initialize

You will write a Python (PythonWin 3.7.0) 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:
PLEASE USE SIMPLE CODES! IT DOES NOT NEED TO BE FANCY OR HAVE EXTRA ABILITIES!
ALSO PLEASE USE LOTS OF #comments SO I KNOW WHAT YOURE DOING AND I CAN LEARN!
image text in transcribed
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) 0.2802 0.1103 0.4420 0.1469 0.1491 0.2584- 0.4561 0.3211 0.2317 0.4036 0.0752 -0.4403 -0.4846 -0.4570 0.0491 0.0961 . 3681 -0.2653 0.3311 0.1477 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 continuea 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 wil 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions