Advertisement
Guest User

new

a guest
Feb 18th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. #TempConvert.py
  2. TempStr=input("")
  3. if TempStr[-1]in['F','f']:
  4.     C=(eval(TempStr[0:-1])32)/1.8
  5.     print("{:2f}C".format(C))
  6. elif TempStr[-1]in['C','c']:
  7.     F=1.8*eval(TempStr[0:-1])+32
  8.     print("{:.2f}F".format(F))
  9. else:
  10.     print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement