[solved]-Write Python Program Tests Function Main Functions Discussed Parts G Create Following List Q39088311
Write a Python program that tests the function main and thefunctions discussed in parts a through g.
Create the following lists:
inStock – 2D list (row size:10, columnsize:4)
alpha – 1D list with 20 elements.
beta – 1D list with 20 elements.
gamma = [11, 13, 15, 17]
delta = [3, 5, 2, 6, 10, 9, 7, 11, 1, 8]
a. Write the definition of the function setZerothat initializes any one-dimensional list to 0(alpha and beta).
b. Write the definition of the functioninputArray that prompts the user to input 20numbers and stores the numbers into alpha.
c. Write the definition of the functiondoubleArray that initializes the elements ofbeta to two times the corresponding elements inalpha.
d. Write the definition of the functioncopyGamma that sets the elements of the first rowof inStock from gamma and theremaining rows of inStock to three times theprevious row of inStock.
e. Write the definition of the functioncopyAlphaBeta that stores alphainto the first five rows of inStock andbetainto the last five rows ofinStock.
f. Write the definition of the functionprintArray that prints any one-dimensional list.The function must contain only one loop to print anyone-dimensional list.
g. Write the definition of the functionsetInStock that prompts the user to input theelements for the first column of inStock. Thefunction should then set the elements in the remaining columns totwo times the
corresponding element in the previous column, minus thecorresponding element in delta.



OUTPUT: -The bold text is the user’s input. – Use tab after displaying each number. Alpha after initialization: 0 Enter 20 integers: 1 2 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 Nm no Alpha after reading 20 numbers: 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Beta after a call to doubleArray: 4 6 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 inStock after a call to copyGamma: 11 13 15 17 33 39 45 51 99 117 135 153 297 351 459 405 891 1053 1215 1377 3159 4131 2673 3645 8019 9477 12393 10935 32805 24057 28431 37179 85293 72171 98415 111537 216513 255879 295245 334611 inStock after a call to copyAlphaBeta: 1 2 3 4 6 7 10 11 12 13 14 15 16 17 18 19 20 2 4 6 CO 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 Enter 10 integers: 21 22 23 24 25 26 27 28 29 30 inStock after a call to setInStock: 21 39 75 147 22 39 73 141 23 44 86 170 24 42 78 150 25 40 70 130 43 26 77 145 47 27 87 167 28 45 79 147 113 29 57 225 30 52 96 184 Show transcribed image text OUTPUT: -The bold text is the user’s input. – Use tab after displaying each number. Alpha after initialization: 0 Enter 20 integers: 1 2 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 Nm no
Alpha after reading 20 numbers: 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Beta after a call to doubleArray: 4 6 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 inStock after a call to copyGamma: 11 13 15 17 33 39 45 51 99 117 135 153 297 351 459 405 891 1053 1215 1377 3159 4131 2673 3645 8019 9477 12393 10935 32805 24057 28431 37179 85293 72171 98415 111537 216513 255879 295245 334611 inStock after a call to copyAlphaBeta: 1 2 3 4 6 7 10 11 12 13 14 15 16 17 18 19 20 2 4 6 CO 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
Enter 10 integers: 21 22 23 24 25 26 27 28 29 30 inStock after a call to setInStock: 21 39 75 147 22 39 73 141 23 44 86 170 24 42 78 150 25 40 70 130 43 26 77 145 47 27 87 167 28 45 79 147 113 29 57 225 30 52 96 184
Expert Answer
Answer to Write a Python program that tests the function main and the functions discussed in parts a through g. Create the followi… . . .
OR

