print Welcome to Celsius Fahrenheit temperature converter 2020 print C

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
print('Welcome to Celsius <=> Fahrenheit temperature converter 2020!')
print('Choose starting temperature...')
print('Type C or F to begin')
startTemp = str(input())
if startTemp == 'C':
print('Type your temperature in Celsius')
c = float(input())
def CtoF(t):
t = c * 1.8 + 32
return t
finalF = CtoF(c)
answerF = str(round(finalF))
c = str(c)
print(c + ' degrees in Celsius is ' + answerF + ' degrees in Fahrenheit')
elif startTemp == 'F':
print('Type your temperature in Fahrenheit')
f = float(input())
def FtoC(t2):
t2 = (f - 32) / 1.8
return t2
finalC = FtoC(f)
answerC = str(round(finalC))
f = str(f)
print(f + ' degrees in Fahrenheit is ' + answerC + ' degrees in Celsius')
else:
print('Incorrect input')
exit()