CJCoding With Joseph
15free / daySign inCreate account

Aligned Grade Table

Add one more entry to grades from input (a name on the first line, a whole-number mark on the second), then write every entry to table.txt as one line with the name padded to 10 characters using :<10 and the mark right-aligned in 4 using :>4, looping over the dict in insertion order (the new entry last). Read the file back with for line in f, print each line without its newline, then print <n> rows with the number of lines read. Input: two lines, no prompt.

Expected Output:

Maya        88
Omar        92
Lee         75
Ana         64
4 rows

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

Hints3 available
Topics:
Files
📥 Auto-Input:
Ana\n64\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.