प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
A list is unpacked into print() with the star operator: print(*[1, 2, 3], sep=''). What is displayed?
सही उत्तर: ग) 123
The * unpacks the list into three separate arguments, printed with an empty separator.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print(min('banana'), max('banana')) ?
सही उत्तर: क) a n
Characters are compared by code value: the smallest letter in "banana" is a and the largest is n.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: d = {'x': 3, 'y': 1, 'z': 2}; print(sorted(d, key=d.get)) ?
सही उत्तर: ग) ['y', 'z', 'x']
Iterating a dict gives its keys; sorting them by their values (1, 2, 3) gives y, z, x.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print(sum(i for i in range(1, 6) if i % 2 == 0)) ?
सही उत्तर: घ) 6
The even numbers from 1 to 5 are 2 and 4, whose sum is 6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print(int('ff', 16) + int('17', 8)) ?
सही उत्तर: ख) 270
int('ff', 16) = 255 and int('17', 8) = 15, so the sum is 270.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In Python the modulo result takes the sign of the divisor. Given that rule, what does print(7 % -3) display?
सही उत्तर: क) -2
In Python the result of % has the sign of the divisor: 7 = (-3) * (-3) + (-2).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: x = 5; x //= 2; x **= 3; print(x) ?
सही उत्तर: ख) 8
5 // 2 = 2, and 2 ** 3 = 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A Python range is given a start, a stop and a step of 5. What does print(list(range(2, 20, 5))) show?
सही उत्तर: क) [2, 7, 12, 17]
range starts at 2 and adds 5 each time while staying below 20.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: a = [3, 1, 2]; b = sorted(a); a.reverse(); print(a, b) ?
सही उत्तर: ख) [2, 1, 3] [1, 2, 3]
sorted() returns a new list and leaves a unchanged; reverse() then reverses a in place to [2, 1, 3].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: print('a1b2'.isalnum(), 'abc'.isalpha(), '12a'.isdigit()) ?
सही उत्तर: क) True True False
'a1b2' has only letters and digits; 'abc' only letters; '12a' contains a letter, so isdigit() is False.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।