Assignment 11 – list creation
Due Thursday, September 22
Homework program big_production.py
Problem
- Get a list of integers from the user and determine their product.
- Along they way to doing so,
- Print the input as a list of strings.
- Print the input as a list of integers.
Notes
- Do not print anything but the requested output.
- This restriction indicates that all debugging output should be removed and that there should be no labelling of your output.
Required algorithm
- Prompt and get as input a list of integer numbers
- Split the input into a list of numeric strings
- Print the list of numeric strings
- Using a list accumulator loop, process the numeric strings one-by-one.
- For each of those strings, get its integer equivalent and append the integer to the list accumulation.
- Print the integer list
- Using a product accumulator loop, process the integers one-by-one.
- For each of the integers, update the accumulator by scaling it by the current integer.
- When building a product, the accumulator is initialized to 1.
- Print the product
Some program runs
Enter list of integers: 1 2 3 4 5
['1', '2', '3', '4', '5']
[1, 2, 3, 4, 5]
120
Enter list of integers: 3 5 9 13 11 2
['3', '5', '9', '13', '11', '2']
[3, 5, 9, 13, 11, 2]
38610
Enter list of integers: 2 -7 9 88
['2', '-7', '9', '88']
[2, -7, 9, 88]
-11088