Computer Science, asked by parasharniyati688, 2 months ago

write a python program to convert temperature from Fahrenheit to celsius and from Celsius to Fahrenheit​

Answers

Answered by Navika31
19

Answer:

Python Program to Convert Celsius To Fahrenheit and Vice Versa

Celsius = (Fahrenheit – 32) * 5/9 Fahrenheit = (Celsius * 9/5) + 32.

celsius = float(input("Enter temperature in celsius: ")) fahrenheit = (celsius * 9/5) + 32 print('%.2f Celsius is: %0.2f Fahrenheit' %(celsius, fahrenheit))

Explanation:

pls mark me as a brainly pls

Answered by IIAstuteIshII
7

ɧɛƖƖơ ɱąɬɛ

Qᴜᴇsᴛɪᴏɴ:

ᴡʀɪᴛᴇ ᴀ ᴘʏᴛʜᴏɴ ᴘʀᴏɢʀᴀᴍ ᴛᴏ ᴄᴏɴᴠᴇʀᴛ ᴛᴇᴍᴘᴇʀᴀᴛᴜʀᴇ Fʀᴏᴍ Fᴀʜʀᴇɴʜᴇɪᴛ ᴛᴏ ᴄᴇʟsɪᴜs ᴀɴᴅ Fʀᴏᴍ ᴄᴇʟsɪᴜs ᴛᴏ Fᴀʜʀᴇɴʜᴇɪᴛ​ .

ᴘʀᴏɢʀᴀᴍ:

# ᴘʀᴏɢʀᴀᴍ ᴜsɪɴɢ ᴘʏᴛʜᴏɴ ᴛᴏ ᴄᴏɴᴠᴇʀᴛ ᴛᴇᴍᴘᴇʀᴀᴛᴜʀᴇ Fʀᴏᴍ ᴄᴇʟsɪᴜs ᴛᴏ Fᴀʜʀᴇɴʜᴇɪᴛ ᴀɴᴅ Fᴀʜʀᴇɴʜᴇɪᴛ ᴛᴏ ᴄᴇʟsɪᴜs.

choice=str(input("enter celcius if you want to convert into celsius else enter fahrenheit "))

if choice.upper()=="CELSIUS":

   f=eval(input("enter the temperature in fahrenheit "))

   c=(f–32) * (5/9)

   print("the given temperature in celsius is : ",c)

elif choice.upper()=="FAHRENHEIT":

   c=eval(input("enter the temperature in celsius"))

   f= (c * 9/5) + 32

   print("the given temperature in fahrenheit is : ",f)

else:

   print("please enter the correct choice")

___________________________

ɴᴏᴛᴇ:

Fᴏʀ ᴍᴏʀᴇ ᴄʟᴀʀɪᴛʏ ʀᴇFᴇʀ ᴛᴏ ᴛʜᴇ ᴀᴛᴛᴀᴄʜᴍᴇɴᴛ

__________________________

ɧơ℘ɛ ıɬ ɧɛƖ℘ʂ ყơų  ☺

Attachments:
Similar questions