Question 17Asked in Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 2 (2:00 PM)

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 ')
  1. AERROR#ERROR#
  2. BWORD5#OVERWORD5#OVER
  3. CWORD5#WORD5#
  4. DERROR#OVERERROR#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।

From Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 2 (2:00 PM)

This is question 17 of Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 2 (2:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.