Write a Python program to input a temperature in Fahrenheit or Celcius, then converts it to the other unit. The program should first input a temperature then input a unit of C or F. It should then convert the temperature to the other unit.
After you get it working initially, re-write it to handle bad input.
Example Run 1:
Enter temperature: 212
In which units is that: C or F? F
That's 100.0 C
Example Run 2:
Enter temperature: 0
In which unit is that: C or F? C
That's 32.0 F
NOTE: You can find the formulas online.
In [1]:
#Step 2: write code here
Now that you have it working, re-write your code to handle bad input using Python's try... except
statement. When the exception occurs, you can just print the message and exit the program.
Example run:
Enter temperature: wicked hot
Sorry, that's not a temperature I can convert.
Note: Exception handling is not part of our algorithm. It's a programming concern, not a problem-solving concern!
In [1]:
## Step 2 (again): write code again but handle errors with try...except
Answer:
Answer:
Answer:
Answer:
Reflect upon your experience completing this assignment. This should be a personal narrative, in your own voice, and cite specifics relevant to the activity as to help the grader understand how you arrived at the code you submitted. Things to consider touching upon: Elaborate on the process itself. Did your original problem analysis work as designed? How many iterations did you go through before you arrived at the solution? Where did you struggle along the way and how did you overcome it? What did you learn from completing the assignment? What do you need to work on to get better? What was most valuable and least valuable about this exercise? Do you have any suggestions for improvements?
To make a good reflection, you should journal your thoughts, questions and comments while you complete the exercise.
Keep your response to between 100 and 250 words.
--== Write Your Reflection Below Here ==--