Advertisements
Advertisements
Question
Consider the statements given below and then choose the correct output from the given options:
N=‘5’
try:
print('WORD' + N, end='#')
except:
print('ERROR',end='#')
finally:
print('OVER')Options
ERROR#WORD5#OVERWORD5#ERROR#OVER
MCQ
Advertisements
Solution
WORD5#OVER
Explanation:
There is no exception here, so the try and finally blocks areexecuted, therefore print ("WORD"+N,end='#') and print('OVER') are executed giving "WORD5#OVER".
shaalaa.com
Is there an error in this question or solution?
