CJCoding With Joseph
15free / daySign inCreate account

People Table

Read people as pairs of lines, a name with the prompt Name: and an age with the prompt Age: (kept as text), until a blank name is entered; store them in two lists with .append(). Then print a header with the words Name and Age and one row per person, every line using the format spec {name:<20} {age:>3} (name left-aligned in 20 columns, a space, age right-aligned in 3), and finally People: <n> using len(). The age for a row comes from the second list at the same position, so keep an index counter beside the for loop. Input: zero or more name/age pairs, then an empty line. Every prompt is part of the output, so all of them run together in front of the header line, as in Expected Output.

Expected Output:

Name: Age: Name: Age: Name: Name                 Age
Maya                  31
Ali                    7
People: 2

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

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