Home > other >  Exception handling to rewrite the temperature conversion
Exception handling to rewrite the temperature conversion

Time:10-17

O great god see
How do you write with the try the except statement rewrite the temperature conversion!

# TempConvert. Py
Val=input (" please input temperature for symbolic value (for example: 32 c) : ")
If val [1] in [' C ', 'C'] :
F=1.8 * float (val [0, 1]) + 32
Print (" after the transformation temperature for: {: 2 F} F ". The format (F))
Elif val [1] in [' F ', 'F'] :
C=(float (val [0, 1]) - 32)/1.8
Print (" after the transformation temperature for: {: 2 f} C ". The format (C))
The else:
Print (" I ")

CodePudding user response:

Try:
If
Elif
The else
Except the Exception as e:
Print (e)
Should be well

CodePudding user response:

reference 1/f, candy cat replies:
try:
If
Elif
The else
Except the Exception as e:
Print (e)
Should be so

So, but write temperature conversion is wrong

CodePudding user response:

Can you post picture
  • Related