प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Running this in Python 3 displays which output? print(type({}))
सही उत्तर: ग) <class 'dict'>
Empty braces {} create an empty dictionary; an empty set must be written set().
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(tuple('ab') + (1,))
सही उत्तर: ख) ('a', 'b', 1)
tuple('ab') is ('a', 'b'), and + concatenates it with (1,).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? d = {'x': 1}; d['y'] = d.get('y', 0) + 5; print(d)
सही उत्तर: क) {'x': 1, 'y': 5}
d.get('y', 0) returns the default 0 because 'y' is missing, so d['y'] becomes 5 without any KeyError.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print('a b c'.split())
सही उत्तर: घ) ['a', 'b', 'c']
split() with no argument splits on runs of whitespace and discards empty strings.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print([1, 2, 3].index(3))
सही उत्तर: ग) 2
index() returns the position of the first occurrence of the value; 3 is at index 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(abs(-3.5), round(3.456, 1))
सही उत्तर: ख) 3.5 3.5
abs(-3.5) is 3.5 and round(3.456, 1) rounds to one decimal place, giving 3.5.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(sorted(['banana', 'Cherry', 'apple']))
सही उत्तर: क) ['Cherry', 'apple', 'banana']
Strings are compared by character codes, and uppercase letters (65-90) come before lowercase letters (97-122), so 'Cherry' sorts first.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(sum([[1], [2, 3]], []))
सही उत्तर: घ) [1, 2, 3]
With the start value [], sum() adds the lists with +, which concatenates them: [] + [1] + [2, 3] = [1, 2, 3].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(len(' hi '.strip()))
सही उत्तर: घ) 2
strip() removes the two leading and two trailing spaces, leaving 'hi', whose length is 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print('nepal'.upper().center(7, '*'))
सही उत्तर: ग) *NEPAL*
upper() gives 'NEPAL' (5 characters), and center(7, '*') pads it to width 7 with one '*' on each side.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।