Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def FtoC(F):
- C = (F - 32) * (5 / 9)
- return C
- def CtoF(C):
- F = C * (9 / 5) + 32
- return F
- inStr = input()
- num = float(inStr[0:len(inStr) - 1])
- if inStr[-1] == "C":
- print(str(CtoF(num)) + "F")
- if inStr[-1] == "F":
- print(str(FtoC(num)) + "C")
Advertisement
Add Comment
Please, Sign In to add comment