प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is the output of the Python code: print(1 < 3 > 2) ?
सही उत्तर: क) True
Python chains comparisons: 1 < 3 > 2 means (1 < 3) and (3 > 2), which is True.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print(max(['kiwi', 'apple', 'fig'], key=len)) ?
सही उत्तर: ख) apple
With key=len, max() returns the element whose length is greatest; 'apple' has 5 characters.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: d = {'a': 1, 'b': 2}; d.update({'b': 5, 'c': 3}); print(d) ?
सही उत्तर: ग) {'a': 1, 'b': 5, 'c': 3}
update() overwrites the value of an existing key and adds new keys.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print(sorted({1, 2, 3} & {2, 3, 4}), sorted({1, 2} ^ {2, 3})) ?
सही उत्तर: ग) [2, 3] [1, 3]
& gives the intersection {2, 3}; ^ gives the symmetric difference, the elements in exactly one set, {1, 3}.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: a, b = 3, 5; a, b = b, a + b; print(a, b) ?
सही उत्तर: घ) 5 8
The right side is evaluated first using the old values (5 and 3 + 5), then assigned to a and b together.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: x, *y = [1, 2, 3, 4]; print(y) ?
सही उत्तर: क) [2, 3, 4]
In extended unpacking the starred name collects all remaining items into a list.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: a = [1, 2]; a.extend('ab'); print(a) ?
सही उत्तर: ख) [1, 2, 'a', 'b']
extend() adds each element of an iterable; a string is iterated character by character.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: a = [[0] * 2] * 2; a[0][0] = 5; print(a) ?
सही उत्तर: ख) [[5, 0], [5, 0]]
Multiplying the outer list copies the reference, so both rows are the same inner list and the change shows in both.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: a = [1, 2, 3]; a.insert(1, 9); print(a) ?
सही उत्तर: ग) [1, 9, 2, 3]
insert(1, 9) places 9 at index 1 and shifts the later elements to the right.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print('42'.zfill(5)) ?
सही उत्तर: घ) 00042
zfill(5) pads the string on the left with zeros until it is 5 characters long.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।