Simplified Celcius or Farenheit Conversion

ch=input("Press 1 (for Farenheit to Celcius)\n or 2 (for Celcius to Farenheit): ")
q=float(input(“Enter the F or C Value”))
if(ch=='1'):
ans=((q-32)*5/9)
elif (ch=='2'):
ans=(q*(9/5))+32
print(“The converted value is ”, ans)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.