Question: Is the following Python code valid (Partial code segment only, no need to consider the rest of this program)? try: #Do something except: O
Is the following Python code valid (Partial code segment only, no need to consider the rest of this program)? try: #Do something except: O a. # Do something else: # Do something no, since there is no such thing as else O b. yes, it is valid O c. no, since else must come before finally O d. no, since else cannot be used with except
Step by Step Solution
There are 3 Steps involved in it
he correct answer is d no since else cannot be used with except In Python the else block in ... View full answer
Get step-by-step solutions from verified subject matter experts
