CJCoding With Joseph
15free / daySign inCreate account

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
Topics:
User Input
📥 Auto-Input:
3.5\n2\n
This input is automatically fed to your program's stdin
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.