प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What does the following Python code print? print(f'{12345.678:,.1f}')
सही उत्तर: क) 12,345.7
The ',' option inserts thousands separators and '.1f' rounds to one decimal place.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print('{:*>5}'.format('ab'))
सही उत्तर: घ) ***ab
'*' is the fill character and '>' right-aligns 'ab' in a field of width 5, so three stars come first.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print(list({'b': 1, 'a': 2}))
सही उत्तर: ख) ['b', 'a']
Converting a dict to a list gives its keys, and Python 3.7+ dictionaries keep insertion order.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? d = {'a': 1, 'b': 2}; print(d.pop('a'), d)
सही उत्तर: ग) 1 {'b': 2}
pop('a') removes the key 'a' and returns its value 1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print({x % 3 for x in range(10)})
सही उत्तर: घ) {0, 1, 2}
A set comprehension keeps only distinct values; x % 3 can only be 0, 1 or 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print(sorted([3, -1, 2], key=abs))
सही उत्तर: क) [-1, 2, 3]
The list is ordered by absolute value (1, 2, 3), but the original elements are kept, so -1 comes first.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? a = [0, 1, 2, 3, 4]; del a[1:3]; print(a)
सही उत्तर: ख) [0, 3, 4]
del a[1:3] removes the elements at indices 1 and 2 (values 1 and 2).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print(' '.join(w[::-1] for w in 'ab cd'.split()))
सही उत्तर: ख) ba dc
Each word is reversed separately ('ab' -> 'ba', 'cd' -> 'dc') and the words keep their order.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print('Hello'.isupper(), 'HELLO'.isupper())
सही उत्तर: क) False True
isupper() is True only if all cased characters are upper case; 'Hello' has lower-case letters.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print(sum(c.isupper() for c in 'Hello World'.swapcase()))
सही उत्तर: ग) 8
swapcase() gives 'hELLO wORLD', which contains 8 capital letters; True values count as 1 in sum().
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।