Format Numbers in Displayed Counts (Task)

In this task, you’ll enhance the output formatting of your wordcount command by aligning the numbers of lines, words, and bytes. This will make your program’s output more readable, especially when dealing with large texts or many files in the future.

Acceptance Criteria

  • Your program should format the output so that the numbers of lines, words, and bytes are right-aligned based on the maximum number of digits among these counts.
  • The formatted output should match the expected results as shown in the examples below.

Examples

Single long word without a trailing newline:

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.