Question
Write a function that takes, as an argument, a temperature in degrees Celsius and returns the equivalent temperature in degrees Fahrenheit, rounding to the nearest
Write a function that takes, as an argument, a temperature in degrees Celsius and returns the equivalent temperature in degrees Fahrenheit, rounding to the nearest integer value. Name your function celsiusToFahrenheit(temperature). Note: you may need to look up the formula to convert from degrees Celsius to degrees Fahrenheit. Google it! Remember that Python has a function, round() that does what you would thinkbut the result may not be an integer. You may want to combine both the round() and int() functions; keep in mind that the int() function does not round, but truncates all digits to the right of the decimal place. Do not assume that the value being passed into the function is an integer, however. The resulting value being returned MUST be an integer, however. For example, >>> celsiusToFahrenheit(0) should return the integer value 32, and >>>celsiusToFahrenheit(100.0) should return the integer value 212. The format of the value returned is important!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started