← Back to Files
Question 432
Aligned Grade Table
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
Sign in to use hintsTopics:
Files
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.