trydigits sys argv[ row while row line "column while column len(digits)number int(digits[column]digit digits[numberline +digit[rowcolumn + print(linerow + except indexerrorprint("usagebigdigits py "except valueerror as errprint(err"in"digitsthe whole code is wrapped in an exception handler that can catch the two things that can go wrong we begin by retrieving the program' command-line argument the sys argv list is -based like all python liststhe item at index position is the name the program was invoked asso in running program this list always starts out with at least one item if no argument was given we will be trying to access the second item in one-item list and this will cause an indexerror exception to be raised if this occursthe flow of control is immediately switched to the corresponding exception-handling blockand there we simply print the program' usage execution then continues after the end of the try blockbut there is no more codeso the program simply terminates if no indexerror occursthe digits string holds the command-line argumentwhich we hope is sequence of digit characters (remember from piece # that identifiers are case-sensitiveso digits and digits are different each big digit is represented by seven stringsand to output the number correctly we must output the top row of every digitthen the next rowand so onuntil all seven rows have been output we use while loop to iterate over each row we could just as easily have done this insteadfor row in ( )and later on we will see much better way using the built-in range(function we use the line string to hold the row strings from all the digits involved then we loop by columnthat isby each successive character in the command-line argument we retrieve each character with digits[columnand convert the digit to an integer called number if the conversion fails valueerror exception is raised and the flow of control immediately switches to the corresponding exception handler in this case we print an error messageand control resumes after the try block as noted earliersince there is no more code at this pointthe program will simply terminate range(