Question: Create a function convTemp, which converts temperature from one of the units Fahrenheit, Celsius and Kelvin, to another from this list. Your function should have
Create a function convTemp, which converts temperature from one of the units Fahrenheit, Celsius and Kelvin, to another from this list. Your function should
have input parameters:
which can be either a number int or float or array
fro which is a character parameter, having possible values Cdefault or Note: from is a reserved word in Python, so we use fro for our
input parameter
to which is a character parameter, having possible values default or
Use the following relations between different units, with in Fahrenheits, in Celsius and in Kelvin:
If from and to happen to be the same units ie the same character variables from the set FK then your function should return the same vector
as the input vector, but should previously print out the warning, which warns a user that these two are the same so the function is not useful in that case
Import the module warnings and use the following command for printing the warning message do not change this command, not even a single character!
warnings.warnYour 'fro' parameter is the same as your to parameter!"
Here are some examples with various inputs and what your function should return. Keep in mind the output vector should be of the same length as the input
vector Also, if you don't specify the values of from or to the default values should be used.
In :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
