Question: The purpose of this question is to write a python program (script) that uses list comprehension, the range function and the zip function. Using list
The purpose of this question is to write a python program (script) that uses list comprehension, the range function and the zip function. Using list comprehension and the range function create a list of integers named sevens containing the integers from 7 to 140 inclusive that are multiples of 7. Using list comprehension create new list of integers by dividing each element in sevens by 2 and then subtracting 3. In a for statement use the zip function to select the numbers from the two lists and print a table as shown below. Be sure to print the header before entering the for loop. Use format codes so that values in the table line up as shown below.
N N/2-3
7 0
14 4
21 7
28 11
35 14
42 18
49 21
56 25
63 28
70 32
77 35
84 39
91 42
98 46
105 49
112 53
119 56
126 60
133 63
140 67
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
