CJCoding With Joseph
15free / daySign inCreate account

Aligned Name And Age

Read a name with the prompt Name: and an age with the prompt Age: (keep the age as text). Print a header line with the words Name and Age, then a row for the person, both using the format spec {name:<20} {age:>3}: the name left-aligned in a field 20 wide, one space, then the age right-aligned in a field 3 wide. Input: two lines. Both prompts print on the first output line in front of the header, since input() does not end the line.

Expected Output:

Name: Age: Name                 Age
Maya                  31

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
Menus & Validation
📥 Auto-Input:
Maya\n31\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.