Ensure Consistent Number Formatting (Task)

In this task, you’ll enhance the wordcount command by ensuring a consistent formatting of the output across multiple lines, which you previously ignored. It’ll involve aligning the numbers in columns when processing multiple files or directories. This feature will make the output slightly more readable.

Acceptance Criteria

  • The program should format the output to align numbers in columns when dealing with multiple files or directories.
  • The number of digits in each column should be consistent across all lines of output.
  • The program should correctly handle directories and files that don’t exist by displaying a meaningful message.
  • If multiple files are processed, then the program should display a total summary line at the end.

Examples

Processing two or more files with various counts:

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.