Question: Python please! Q3:take input from command line using argparse Make a program that reads a temperature in Fahrenheit Degree or Celsius degree from command line

Python please!

Q3:take input from command line using argparse

Make a program that reads a temperature in Fahrenheit

Degree or Celsius degree from command line using argparse module and convert to Celsius or Fahrenheit correspondingly. The program should be able to run as below

python tempconvert.py f 100 this should read the temperature in Fahrenheit and the program should compute the corresponding temperature in Celsius degrees and print it out as:

input: 100 degree(F)

output: 37.77 degree(C)

when you run the program as:

python tempconvert.py c 100 this should read the temperature in Celsius and the program should compute the corresponding temperature in Fahrenheit degrees and print it out as:

input: 100 degree(C)

output: 212 degree(F)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!