प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Running this in Python 3 displays which output? print(len(range(0, 20, 5)))
सही उत्तर: घ) 4
range(0, 20, 5) produces 0, 5, 10 and 15 (20 is excluded), which is 4 values.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print('abcdef'[::3])
सही उत्तर: ग) ad
A step of 3 takes the characters at indices 0 and 3, which are 'a' and 'd'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print((1, 2) * 2)
सही उत्तर: ख) (1, 2, 1, 2)
Multiplying a tuple by an integer repeats its elements.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(divmod(-7, 2))
सही उत्तर: क) (-4, 1)
Python's // floors towards minus infinity, so -7 // 2 = -4, and -7 % 2 = 1 because -4 * 2 + 1 = -7.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(set('hello') == set('olleh'))
सही उत्तर: घ) True
Both sets contain the same letters {'h', 'e', 'l', 'o'}, and sets ignore order and duplicates.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print([int(n ** 0.5) for n in (4, 9, 16)])
सही उत्तर: ग) [2, 3, 4]
n ** 0.5 is the square root as a float, and int() converts 2.0, 3.0 and 4.0 to 2, 3 and 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(''.join(sorted('cba')))
सही उत्तर: ख) abc
sorted('cba') returns the list ['a', 'b', 'c'], and ''.join() joins it into the string 'abc'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print([c for c in 'banana' if c != 'a'])
सही उत्तर: क) ['b', 'n', 'n']
The comprehension keeps every character except 'a', in order, as a list.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print(bool('False'))
सही उत्तर: क) True
Any non-empty string is truthy, so bool('False') is True; only the empty string is False.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Running this in Python 3 displays which output? print('%d-%s' % (5, 'x'))
सही उत्तर: घ) 5-x
The % operator formats the string, replacing %d with 5 and %s with 'x'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।