How to convert Celsius in Fahrenheit ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to convert Celsius in Fahrenheit ?

In the Python Core test i don't understand hove to write code with "def" and "conv". So I use principal code celsius = float(input()) fahrenheit =(celsius * 9/5)+32 print(fahrenheit)

1st Jul 2022, 12:24 PM
Eugene Nester
Eugene Nester - avatar
3 Answers
+ 3
HINT: Temperature could be in the form of decimal numbers or float, not just integers.
1st Jul 2022, 1:06 PM
noteve
noteve - avatar
+ 1
I get it, change to float(input())
1st Jul 2022, 1:18 PM
Eugene Nester
Eugene Nester - avatar
+ 1
def is an abbreviation for define and used for defining any function in python Example:- def sum_fun(a,b): return a+b print (sum(4,6)) # Output = 10
1st Jul 2022, 1:32 PM
Muhammad Galhoum
Muhammad Galhoum - avatar