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:

  1. tempA| execute theconvert_tempfunction to convert the temperature 95 degrees Fahrenheit into degrees Celsius
  2. 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

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 Programming Questions!