Question: For the answer I tried a = 1 b = 5 n = 8 h = (b-a) / n List = [] for i in

For the answer I tried
a = 1 b = 5 n = 8 h = (b-a) / n List = [] for i in range(n+1): List.append(a+i*h) print (List)
But this is what I get returned
[1] [1, 1] [1, 1, 1] [1, 1, 1, 1] [1, 1, 1, 1, 1] [1, 1, 1, 1, 1, 1] [1, 1, 1, 1, 1, 1, 1] [1, 1, 1, 1, 1, 1, 1, 1] [1, 1, 1, 1, 1, 1, 1, 1, 1]
3. generate equally spaced coordinates We want to generate n 1 equally spaced coordinates in la, b]. Store the coordinates in a list. Start with an empty list, use a for loop and append each coordinate to the list. With n intervals, corresponding to n+ 1 points, in [a, b], each interval has length h -a). The coordinates can then be generated by the formula Xi = a + ih, i = 0, .., n + 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
