Consider Following Code Segment Try Inputfile Open Lyricstxt R Line Inputfilereadline Word Q37059356

Consider the following code segment: try inputFile-open(lyrics.txt, r) line -inputFile.readline() words line.split() prin

Consider the following code segment: try inputFile-open(“lyrics.txt”, “r”) line -inputFile.readline() words line.split() print(words [len(words)]) print(“Error.”) The statement print (words [len (words)]) will raise an exception. What should be placed in the blank so that this exception will be caught and the error message will be displayed? Select one: o a except RuntimeError o b except EnvironmentError O C except IndexError except IOError Show transcribed image text Consider the following code segment: try inputFile-open(“lyrics.txt”, “r”) line -inputFile.readline() words line.split() print(words [len(words)]) print(“Error.”) The statement print

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.