Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON get input value from command line Consinder simplest program for evaluating the formula y(t)=v0t-0.5gt 2 v0=3 g = 9.81 t= 0.6 y= v0*t
IN PYTHON
get input value from command line Consinder simplest program for evaluating the formula y(t)=v0t-0.5gt2
v0=3
g = 9.81
t= 0.6
y= v0*t - 0.5*g*t**2
print y
Improve above program by letting users input v0 and t from command line using the following method. It also should set default values to v0=10 and default t value to 1. ( use argparse module)
Your program should run like this: python p5b.py v 5 t 0.8 , which will assign 5 to v0 and 0.8 to t. python p5b.py v 5 will assign 5 to v0 and 1 to t.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started