From f4f52d9441dd31179ea75af4b7b53e827ca6dcf7 Mon Sep 17 00:00:00 2001 From: Lukas Baumann Date: Wed, 17 Feb 2021 11:45:48 +0100 Subject: [PATCH] Update 1.py --- 15/b/1.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/15/b/1.py b/15/b/1.py index 4c469f1..d6424ff 100644 --- a/15/b/1.py +++ b/15/b/1.py @@ -1,7 +1,6 @@ temp = input() -if "C" in temp: - temp = float (temp[:-1]) - print(temp*9/5+32, "F", sep="") +temp_num = float (temp[:-1]) +if "C" == temp[-1]: + print(temp_num*9/5+32, "F", sep="") else: - temp = float (temp[:-1]) - print((temp-32)*5/9, "C", sep="") + print((temp_num-32)*5/9, "C", sep="")