Consider the statements given below and then choose the correct output from theनीचे दिये गये स्टेटमेंट्स (Statements) पर विचार कीजिए और फिर दिये गये विकल्पों (Options) से
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 ')
नीचे दिये गये स्टेटमेंट्स (Statements) पर विचार कीजिए और फिर दिये गये विकल्पों (Options) से
सही आउटपुट (Output ) चुनिए :
N='5'
try :
print ( 'WORD ' + N, end= '#')
except :
print ( 'ERROR' , end= ' # ' )
finally :
print ( ' OVER ')
Show answerHide answer
Correct answer: (B) WORD5#OVERWORD5#OVER
Explanation
The try block runs without error: 'WORD ' + '5' prints WORD 5 with end='#'. except is skipped, and finally always runs, printing OVER on the same line, giving WORD 5# OVER.try ब्लॉक बिना त्रुटि चलता है: 'WORD ' + '5' end='#' के साथ WORD 5 प्रिंट करता है। except छूट जाता है और finally हमेशा चलता है, उसी लाइन पर OVER प्रिंट करता है, यानी WORD 5# OVER।