कम्प्युटर र सूचना प्रविधि (प्राविधिक)
कम्प्युटर र सूचना प्रविधि (प्राविधिक)
Computer & IT (Technical) · ५,०७६ प्रश्न
५,०७६ प्रश्न उपलब्ध। मोड छान्नुहोस्:
कम्प्युटर र IT: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
A nested list comprehension builds a 2-row table in Python: [[i * j for j in range(3)] for i in range(2)]. What is the resulting list?
सही उत्तर: घ) [[0, 0, 0], [0, 1, 2]]
The outer comprehension makes one row for i = 0 and i = 1; each row is [i*0, i*1, i*2].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: x = [1, 2, 3]; then for i in x: if i == 2: x.remove(i); finally print(x) ?
सही उत्तर: ग) [1, 3]
When 2 is removed, 3 shifts into its position and is skipped by the loop, but it is not removed; x becomes [1, 3].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, def f(a, b=2, *c): return a + b + len(c). What does print(f(1), f(1, 5, 7, 9)) display?
सही उत्तर: ख) 3 8
f(1) = 1 + 2 + 0 = 3; in f(1, 5, 7, 9), b = 5 and c = (7, 9), so 1 + 5 + 2 = 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A Python dictionary literal uses both 1 and True as keys. What does print({1: 'a', True: 'b'}) display?
सही उत्तर: क) {1: 'b'}
True == 1 and they have the same hash, so they are the same key; the first key object (1) is kept and its value is updated to 'b'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, what is printed by: try: x = int('7') + 'a' / except ValueError: print('V') / except TypeError: print('T') ?
सही उत्तर: घ) T
int('7') succeeds; adding the int 7 to the string 'a' raises TypeError, so 'T' is printed.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, class C has a class attribute x = [] . What is printed by: a = C(); b = C(); a.x.append(1); print(b.x) ?
सही उत्तर: ग) [1]
append changes the single list shared by the class, so every instance sees [1]; no new instance attribute is created.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python, class P has __init__(self, n) storing self.n = n and __add__(self, o) returning P(self.n + o.n). What does print((P(2) + P(5)).n) display?
सही उत्तर: ख) 7
The + operator calls the overloaded __add__, which returns a new P whose n is 2 + 5 = 7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: g = (i for i in range(3)); print(sum(g), sum(g)) ?
सही उत्तर: क) 3 0
The first sum consumes the generator (0 + 1 + 2 = 3); a generator can be iterated only once, so the second sum is 0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
When max() is applied directly to a dictionary in Python, what does print(max({'a': 3, 'b': 1})) display?
सही उत्तर: घ) b
Iterating over a dictionary gives its keys, so max() compares 'a' and 'b' and returns 'b'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print(round(3.14159, 3), round(1234, -2)) ?
सही उत्तर: ग) 3.142 1200
round(x, 3) keeps three decimals (3.142); a negative ndigits rounds to the left of the decimal point, so 1234 becomes 1200.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।