कम्प्युटर / सूचना प्रविधि कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक – प्राविधिक पत्र
कम्प्युटर / सूचना प्रविधि – कम्प्युटर अपरेटर (पाँचौँ तह) र सहायक
Computer Operator & Assistant · Computer & IT Posts
२,५७७ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्राविधिक पत्र: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ५ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
In Python, x = 10 is defined at module level, and def f(): global x; x += 5. What does print(x) display after calling f() twice?
सही उत्तर: घ) 20
The global statement makes f change the module-level x, so it becomes 15 and then 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: from collections import Counter; print(Counter('banana').most_common(1)) ?
सही उत्तर: ग) [('a', 3)]
Counter counts each character (a: 3, n: 2, b: 1) and most_common(1) returns a list with the most frequent pair.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: s = set(); s.add((1, 2)); s.add((2, 1)); s.add((1, 2)); print(len(s)) ?
सही उत्तर: ख) 2
Tuples are hashable and order matters, so (1, 2) and (2, 1) are different; the repeated (1, 2) is ignored.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Testing the truth value of None, a zero float and a one-space string in Python: what does print(bool(None), bool(0.0), bool(' ')) display?
सही उत्तर: घ) False False True
None and 0.0 are falsy, but a string containing a space is non-empty and therefore truthy.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python: try: x = [1, 2][2] / except IndexError: x = -1 / finally: x += 10. What does print(x) display afterwards?
सही उत्तर: घ) 9
Index 2 is out of range, so x = -1; the finally block always runs and adds 10, giving 9.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, class Bag stores self.items = [1, 2, 3] in __init__ and defines __len__(self) returning len(self.items). What does print(len(Bag()) * 2) display?
सही उत्तर: क) 6
len() calls the object's __len__ method, which returns 3, and 3 * 2 = 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, class A defines f() returning 'A', class B(A) defines nothing new, class C(A) overrides f() to return 'C', and class D(B, C) is empty. What does print(D().f()) display?
सही उत्तर: ग) C
Python's method resolution order for D is D, B, C, A, so C.f is found before A.f.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, class A has __init__ setting self.v = 1 and a method inc(self) that does self.v += 1 and returns self. What does print(A().inc().inc().v) display?
सही उत्तर: घ) 3
Because inc() returns the same object, the calls can be chained; v goes from 1 to 3.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: nums = [1, 2, 3, 4, 5]; print(nums[1::2], nums[::-2]) ?
सही उत्तर: क) [2, 4] [5, 3, 1]
[1::2] starts at index 1 with step 2; [::-2] starts from the end with step -2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Python string formatting with the percent presentation type: what does print('{:.1%}'.format(0.256)) display?
सही उत्तर: ख) 25.6%
The % format multiplies by 100 and adds a percent sign, here with one decimal place.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।