""" Exercise 2.9 from "A primer on... """ v0 = 5 g = 9.81 n = 10 t_stop = 2 * v0 / g h = t_stop / n time = [] y = [] for i in range(n + 1): t = i * h y.append(v0 * t - 0.5 * g * t**2) time.append(t) #loop through the list and print the t, y pairs: #first using range and indexing: for i in range(len(time)): print(f"{time[i]:2.2f} {y[i]:2.2f}") print("================") #Exact same output, but using zip instead of indexing: for ti, yi in zip(time, y): print(f"{ti:2.2f} {yi:2.2f}") """ Terminal> python ball_table2.py 0.00 0.00 0.10 0.46 0.20 0.82 0.31 1.07 0.41 1.22 0.51 1.27 0.61 1.22 0.71 1.07 0.82 0.82 0.92 0.46 1.02 0.00 ================ 0.00 0.00 0.10 0.46 0.20 0.82 0.31 1.07 0.41 1.22 0.51 1.27 0.61 1.22 0.71 1.07 0.82 0.82 0.92 0.46 1.02 0.00 """