Question: The cell below includes a function that has been provided for you. After understanding the code in the function, run the cell below (to define
The cell below includes a function that has been provided for you. After understanding the code in the function, run the cell below (to define this function). Then, execute (use) this function to create the following variables under the specified conditions:
- tempA| execute theconvert_tempfunction to convert the temperature 95 degrees Fahrenheit into degrees Celsius
- tempB| executeconvert_tempto convert the temperature 17 degrees Celsius into degrees Fahrenheit
def convert_temp(temp, input_unit='F'):
if input_unit == 'F':
out_temp = (temp - 32) * 5/9
elif input_unit == 'C':
out_temp = (temp * 9/5) + 32
else:
print("Please specify either 'F' or 'C' for input_unit")
return out_temp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
