Advertisement
ayshan

Celsius to Fahrenheit or vice versa

Mar 24th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. t = input()
  2. sign = t[-1]
  3. t = int(t[0:-1])
  4. if sign == 'C' or sign == 'c':
  5. t_f = round(t * (9/5) + 32)
  6. print(str(t)+'C','is', str(t_f),'in','Fahrenheit')
  7. elif sign == 'F' or sign == 'f':
  8. t_c = round((t - 32) * (5/9))
  9. print(str(t) + 'F','is', str(t_c),'in','Celsius')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement