Computer Science, asked by PurvanshiAttri, 6 hours ago

WAP to convert temperature entered in celsius to Fahrenheit.(Python programming) ​

Answers

Answered by XxMrZombiexX
288

Conversion formula:

 \sf \: T(℉) = T(℃) x 9/5 + 32 \\  \\ \sf Or, \\  \\  \sf \: T(℉) = T(℃) x 1.8 + 32

Input

 \sf \green{ \# Collect \:  input \:  from \:  the \:  user}

 \sf \: celsius = float(input( \blue{'Enter \:  temperature \:  in  \: Celsius: '}))

 \sf \green{ \# calculate \:  temperature \:  in \:  Fahrenheit  }

 \sf \: fahrenheit = (celsius * 1.8) + 32

\sf\purple{print}'%0.1f Celsius is equal to %0.1f degree Fahrenheit'%(celsius,fahrenheit))

_____________________

Output

>>>Celsius = floss (input ('Enter temperature in Celsius'))

Enter temperature in Celsius : 37

>>> #calculate temperature in Fahrenheit

>>> Fahrenheit = ( Celsius* 1.8) + 32

>>>print('%0.1f Celsius is equal to % 0.1f degree Fahrenheit' % (Celsius, Fahrenheit))37.0 Celsius is equal to 98.6 degree Fahrenheit

___________________

Note : - see output in pic ⬆️

Attachments:
Similar questions