How to convert temperature from Celsius to Fahrenheit In python. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 10

How to convert temperature from Celsius to Fahrenheit In python.

13th Jul 2019, 5:35 PM
Ashourya Saxena
Ashourya Saxena - avatar
14 Answers
+ 12
Actually, the formula is provided on the question page. You just have to copy and paste into the function. https://code.sololearn.com/cmb1VX4r61pq/?ref=app
18th Dec 2020, 6:01 PM
Lam Wei Li
Lam Wei Li - avatar
+ 4
celsius = int(input()) def conv(c): f= ((9/5)* c) + 32 return f fahrenheit = conv(celsius) print(fahrenheit)
22nd Apr 2021, 2:29 PM
Prateek Gupta
Prateek Gupta - avatar
+ 1
c=float(input()) fahrenheit= (9/5*c)+32 print (fahrenheit)
24th Jan 2022, 8:14 PM
Kass Hadla
Kass Hadla - avatar
0
I actually got it right by mistake I was defining conv(x) as print(9/5 * x + 32) This would return the correct answer and then none. Not what we want. So i tried to investigate why the correct answer would print followed by none. I ran the code with the comment and BOOOM! PASS! and I was like. no I didn't. why did this work? I investigated my accidental win. It turns out the code was printing conv(celsius) in other words it was printing print(9/5 * celsius + 32) Printing a print statement hmmmmm XD
9th Feb 2021, 10:15 PM
Renier Fourie
Renier Fourie - avatar
- 1
celsius = int(input()) def conv(c): # Your code goes here fahrenheit= ((9/5)* c) + 32 return fahrenheit fahrenheit = conv(celsius) print(fahrenheit)
21st Aug 2021, 4:55 PM
Charu
Charu - avatar
- 1
other form to complete the challenge is #includecholo conversor de grados celsius a fahrenheit celsius=int(input()) def conv(celsius): vl1=9/5*celsius+32 result=vl1 print(result) conv(celsius) finally the result is the grades fahrenheit
12th Nov 2021, 6:08 PM
Cholohatwhite
Cholohatwhite - avatar
- 1
celsius = int(input()) def conv(c): #your code goes here f = (9/5) * c + 32 return f fahrenheit = conv(celsius) print(fahrenheit) Ask if u have some questions!
17th Nov 2021, 10:04 AM
Stefan Bartl
Stefan Bartl - avatar
- 1
celsius = int(input()) #taking input from the user def conv(c): #defining our function # Your code goes here fahrenheit= ((9/5)* c) + 32 return fahrenheit fahrenheit = conv(celsius) #calling our function print(fahrenheit) #take care of indentation in your code
27th Feb 2022, 12:28 PM
Nahom Fekadu
- 2
The formula is this: F = C * 9 / 5 + 32. It's not that hard, try to do it yourself
13th Jul 2019, 5:38 PM
Airree
Airree - avatar
- 2
Easy code 👌 celsius = int(input()) f = (celsius * 9/5) + 32 print(f)
29th Dec 2020, 6:08 PM
MaryRif
MaryRif - avatar
- 2
Bro, celsius = int(input()) f = (celsius * 9/5) + 32 print(f)
31st Dec 2020, 5:39 PM
MaryRif
MaryRif - avatar
- 2
celsius = int(input()) def conv(c): #your code goes here return 9/5 * c + 32 fahrenheit = conv(celsius) print(fahrenheit)
11th Feb 2021, 6:10 PM
Md Momin Uddin Hridoy
Md Momin Uddin Hridoy - avatar
- 2
celsius = int(input()) def conv(c): return 9/5*c+32 fahrenheit = conv(celsius) print(fahrenheit)
15th May 2021, 8:39 AM
Maxwell D. Dorliea
Maxwell D. Dorliea - avatar