Python Output-Based Python Questions क्विज़

Many Python interviews hand you a snippet and ask "what does this print?". This quiz is ten of those, each mixing two ideas such as rebinding vs mutation, slicing with steps, sort keys or exhausted generators.

मीडियम 10 सवाल ~6 मिनट पास होने के लिए 80% Python 3.12

मोड चुनें

आप गेस्ट के तौर पर खेल रहे हैं: XP और streak सेव रखने के लिए साइन इन करें।

सैंपल सवाल

सवाल 1 / 10

What does this print?

a = [1]
b = a
a = a + [2]
c = [1]
d = c
c += [2]
print(b, d)
जवाब दिखाएं

A. [1] [1, 2] a + [2] builds a new list and rebinds a, so b still points to the old [1]. c += [2] extends the list in place, and d is that same list, so it shows [1, 2].

इस क्विज़ में क्या है

  • a = a + [x] vs a += [x]
  • Slicing with steps and negative steps
  • Dict comprehensions with repeated keys
  • Sort keys that use tuples
  • Generators that can only be used once

अक्सर पूछे जाने वाले सवाल

क्या अकाउंट ज़रूरी है?

नहीं। कोई भी खेल सकता है। XP, streak, badge और हिस्ट्री सेव रखने के लिए साइन इन करें।

कौन-सा Python वर्ज़न?

Python 3.12। आउटपुट वाले हर सवाल को कोड रन करके जांचा गया है।

क्या मैं इसे दोबारा दे सकता हूं?

हां। आपका बेस्ट स्कोर सेव रहता है, और हर बार सवाल और जवाब शफ़ल होते हैं।