""" Ex. 5.9 from "A Primer on... The exercise requires that you read arguments for v0 from the command line, so the program must be run from the terminal. If you run it using the button in VS code or spider, the variable v0_list will be an empty list, none of the code lines inside the for loop will be run, and the resulting plot will be empty. """ import numpy as np import matplotlib.pyplot as plt import sys #v0 = 10 v0_list = sys.argv[1:] g = 9.81 for v0 in v0_list: v0 = float(v0) t = np.linspace(0, 2*v0/g, 101) y = v0 * t - 0.5 * g * t**2 plt.plot(t,y) plt.xlabel("time (s)") plt.ylabel("height (m)") plt.show() """ Terminal> plot_ball2.py 10 12 20 (output is a plot) """