← Back to User Input
Question 189
Area And Perimeter Together
Area And Perimeter Together
Ask for the width and the height of a rectangle with the prompts Width? and Height? (each ending in a space), convert both with float(), and print two lines, Area: <value> and Perimeter: <value>, each with one decimal using :0.1f. Input: two lines, one number each. The prompts are part of the output and input() does not move to a new line, so both prompts and the area share the first output line, as shown in Expected Output.
Expected Output:
Width? Height? Area: 7.0 Perimeter: 11.0
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
User Input
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.