Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago