Question: Write a Python program that declares two lists. Write a Python program that declares two lists. a. Set the values in the first list to
Write a Python program that declares two lists. a. Set the values in the first list to [-3, 0, 3, 6] by initializing on the line where the list is declared. Print the elements of the list using fields 3 characters wide for each element. Build the first list up to [-3, 0, 3, 6] by starting with an empty list [ and using a counting loop whose loop index variable goes from 1 to 4 and finding a formula that converts the loop variable into the needed values. Use the append member function of the list to add to the list. (Spend some time thinking about this, as it may be useful later.) Print the list using fields 5 characters wide for each element. b. c. Declare an empty list. Use a loop and, within it, prompt the user for integer values (they needn't be the ones from parts a and b) and add each value the user enters into the first array directly. After each number is entered, ask the user whether or not to continue After the user chooses not to enter more numbers, print the list Use a loop to fill a second array with the values from the first array from part c) in reverse order. Print the second array. d
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
