← Back to Menus & Validation
Question 454
Celsius Or Fahrenheit
Celsius Or Fahrenheit
A conversion menu: 1) Celsius to Fahrenheit reads a temperature with the prompt Celsius: (convert with float()) and prints it converted with c * 9 / 5 + 32 followed by a space and F; 2) Fahrenheit to Celsius reads with the prompt Fahrenheit: and prints (f - 32) * 5 / 9 followed by C; both values use one decimal (:.1f). 3) Quit prints Goodbye! and leaves the loop; anything else prints Unknown choice - try again.. Input: one line per choice or temperature, ending with 3. Prompts are part of the output, so a result follows its temperature prompt on the same line.
Expected Output:
1) Celsius to Fahrenheit 2) Fahrenheit to Celsius 3) Quit Choice: Celsius: 212.0 F 1) Celsius to Fahrenheit 2) Fahrenheit to Celsius 3) Quit Choice: Fahrenheit: 100.0 C 1) Celsius to Fahrenheit 2) Fahrenheit to Celsius 3) Quit Choice: Goodbye!
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Menus & Validation
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.