Marcus runs a local courier business and wants to write a software tool to audit the formatting of tracking codes stored in a text document.
The text file tracking_codes.txt contains one tracking code on each line.
He wants a program to check each tracking code to ensure that:
0–9)If a tracking code does not meet these requirements, the program must:
After all tracking codes in the file have been checked, the program must display the total count of non-compliant codes.
Write an algorithm, in Python or pseudocode, to solve Marcus's problem. You can use the incomplete program structure provided below to help you write your solution.
# Open the file
file = open("tracking_codes.txt", "r")
invalid_count = 0
# Loop through each line in the file
for line in file:
code = line.strip()
# Write your validation logic below
# Close the file and display the final count
file.close()