229k views
3 votes
Write a python function converting Celsius to Fahrenheit

User Robby Pond
by
8.3k points

1 Answer

5 votes

Answer:

Fahrenheit = (Celsius * 9/5) + 32

Here's a Python function that implements this conversion:

python

Copy code

def celsius_to_fahrenheit(celsius):

fahrenheit = (celsius * 9/5) + 32

return fahrenheit

# Example usage:

celsius_temperature = 25

fahrenheit_temperature = celsius_to_fahrenheit(celsius_temperature)

print(f"{celsius_temperature} degrees Celsius is equal to {fahrenheit_temperature} degrees Fahrenheit.")

You can replace the celsius_temperature variable with the temperature you want to convert, and the function will return the equivalent temperature in Fahrenheit.

User Nitesh Goel
by
8.2k points

No related questions found