Python Variables: Dynamic Typing and Multiple Assignments Notes in Hindi & English : पायथन वैरिएबल्स: डायनामिक टाइपिंग और एक साथ कई मान असाइन करना और 20 महत्वपूर्ण MCQ प्रश्न (Rajasthan IT Exam)

Post a Comment

PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Python Variables: Dynamic Typing and Multiple Assignments (पायथन वैरिएबल्स: डायनामिक टाइपिंग और एक साथ कई मान असाइन करना) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।

Overview: In Python, variables are untyped names (references) dynamically bound to objects allocated on the heap, meaning a single name can be rebound to objects of different types at runtime without explicit declarations. Python supports chained assignments (`a = b = 0`), parallel tuple unpacking (`x, y = 10, 20` and `a, b = b, a`), starred extended unpacking (`first, *rest`), and assignment expressions (`:=`).

अध्याय सार: पायथन में वेरिएबल्स बिना किसी डेटा टाइप घोषणा के हीप मेमोरी में बने ऑब्जेक्ट्स के रेफरेंस (नाम) होते हैं, जिन्हें रन-टाइम पर किसी भी टाइप के ऑब्जेक्ट से जोड़ा (डायनामिक टाइपिंग) जा सकता है। पायथन चेन्ड असाइनमेंट (`a = b = 0`), पैरेलल टपल अनपैकिंग (`a, b = b, a`), स्टार्ड अनपैकिंग (`first, *rest`) और वॉलरस ऑपरेटर (`:=`) सपोर्ट करता है।

Python Variables: Dynamic Typing and Multiple Assignments: Detailed Notes & Architecture (पायथन वैरिएबल्स: डायनामिक टाइपिंग और एक साथ कई मान असाइन करना)

1. Variables as Object References (id, type, value) (ऑब्जेक्ट रेफरेंस के रूप में वेरिएबल्स (id, type, value))

[EN] Unlike C variables that represent fixed typed memory boxes, a Python variable is simply a label bound to an object in heap memory when `=` executes. Every Python object carries three core traits: an identity (`id(obj)`, returning its memory address in CPython), a runtime type (`type(obj)`), and a value. Assigning `b = a` copies only the reference (aliasing), making `a is b` evaluate to `True`; deleting the name with `del a` unbinds `a` (decrementing reference count) and raises `NameError` if accessed afterward.

[HI] C भाषा के वेरिएबल्स (निश्चित मेमोरी बॉक्स) के विपरीत, पायथन वेरिएबल हीप पर बने ऑब्जेक्ट का एक लेबल (रेफरेंस) होता है जो `=` चलते ही बनता है। हर ऑब्जेक्ट की तीन विशेषताएँ होती हैं: पहचान (`id()`), प्रकार (`type()`) और मान (value)। `b = a` करने पर केवल रेफरेंस कॉपी होता है (`a is b` `True` होता है), और `del a` लिखने पर वह नाम नेमस्पेस से हट जाता है (पुनः एक्सेस करने पर `NameError` आता है)।

2. Dynamic Typing and Interning Behavior (डायनामिक टाइपिंग और ऑब्जेक्ट इंटरनिंग (Interning))

[EN] Because type lives with the object rather than the variable name, rebinding `x = 10` to `x = "hello"` and then `x = [1, 2]` changes `type(x)` seamlessly at runtime. To test types cleanly, `isinstance(x, int)` is preferred over `type(x) == int` because `isinstance` respects inheritance (e.g., `bool` is a subclass of `int`). CPython optimizes memory via **interning**: small integers (`-5` to `256`) and identifier-like strings are cached, so two separate variables assigned `256` share the exact same `id()`, whereas `1000` created dynamically may have different `id()`s (`==` checks value equality, `is` checks object identity).

[HI] चूँकि टाइप वेरिएबल पर नहीं बल्कि ऑब्जेक्ट पर होता है, इसलिए `x = 10` के बाद `x = "hello"` करने पर `type(x)` रन-टाइम पर स्वतः बदल जाता है। टाइप जाँचने के लिए `type(x) == int` से बेहतर `isinstance(x, int)` माना जाता है क्योंकि यह इनहेरिटेंस को भी समझता है। CPython मेमोरी बचाने के लिए `-5` से `256` तक के छोटे पूर्णांकों को इंटरन (cache) करता है; `==` मान की समानता और `is` एक ही मेमोरी ऑब्जेक्ट (`id()`) की जाँच करता है।

3. Chained Assignment and Mutable Pitfalls (चेन्ड असाइनमेंट और म्यूटेबल ऑब्जेक्ट की सावधानी)

[EN] Chained assignment (`a = b = c = 100`) evaluates the rightmost expression once and binds all target names on the left to that single object. For immutable types (`int`, `str`, `tuple`), reassigning `a = 200` simply rebinds `a` to a new object without affecting `b` or `c`. However, for **mutable** objects like `a = b = []`, all names alias the exact same list, so mutating `a.append(5)` modifies `b` as well; distinct empty lists require `a, b = [], []`.

[HI] चेन्ड असाइनमेंट (`a = b = c = 100`) दाईं ओर का मान एक बार निकालकर सभी वेरिएबल्स को उसी एक ऑब्जेक्ट से जोड़ देता है। इम्यूटेबल टाइप्स (`int`, `str`, `tuple`) में `a = 200` करने पर केवल `a` नया ऑब्जेक्ट चुनता है और `b, c` अप्रभावित रहते हैं। परंतु म्यूटेबल लिस्ट के साथ `a = b = []` करने पर `a.append(5)` से `b` भी बदल जाता है; अलग-अलग लिस्ट बनाने के लिए `a, b = [], []` लिखना चाहिए।

4. Parallel Unpacking, Starred Targets, and Walrus (:=) (पैरेलल अनपैकिंग, स्टार्ड टारगेट और वॉलरस ऑपरेटर (:=))

[EN] Python evaluates the entire right-hand side tuple before binding left-hand targets in parallel assignments (`x, y, z = 1, "py", True`), which allows swapping two variables without a temporary variable via `a, b = b, a`. If the item counts mismatch, Python raises `ValueError`, unless a starred target (PEP 3132, e.g., `head, *middle, tail = [1, 2, 3, 4]`) collects zero or more extra items into a `list` (`middle == [2, 3]`). Python 3.8+ also introduced the walrus assignment expression operator (`:=`, PEP 572), binding a variable inside an expression such as `if (n := len(items)) > 3:`.

[HI] पैरेलल असाइनमेंट (`x, y, z = 1, "py", True`) में पहले दायाँ टपल पूरा मूल्यांकित होता है और फिर बाएँ वेरिएबल्स से जुड़ता है, जिससे बिना थर्ड वेरिएबल के `a, b = b, a` स्वैपिंग हो जाती है। PEP 3132 स्टार्ड अनपैकिंग (`head, *mid, tail = [1,2,3,4]`) अतिरिक्त मानों को एक `list` (`mid == [2,3]`) में इकट्ठा कर लेती है। पायथन 3.8 में आया वॉलरस ऑपरेटर (`:=`) `if (n := len(items)) > 3:` जैसे एक्सप्रेशन के भीतर ही असाइनमेंट की सुविधा देता है।

Syntax, Formula & Technical Example (Python Variables: Dynamic Typing and Multiple Assignments)

x = 10; print(type(x), id(x))
x = "AI"                 # Dynamic rebinding to str
a = b = 0                # Chained assignment
p, q = 5, 10
p, q = q, p              # Tuple unpacking swap: p=10, q=5
first, *mid, last = [10, 20, 30, 40]
print(p, q, mid)         # 10 5 [20, 30]

Python Variables: Dynamic Typing and Multiple Assignments Quick Reference & Comparison Table

Assignment FormSyntax ExampleBehavior & Exam Note
Dynamic Rebindingx = 5; x = 'hi'Same name binds to new heap object & type
Chained Assignmenta = b = []All targets alias single object (careful with mutables)
Parallel Tuple Swapa, b = b, aEvaluates RHS tuple before LHS binding; no temp var
Starred Unpackingh, *m, t = [1,2,3,4]Starred target always produces a list (m=[2,3])

Python Variables: Dynamic Typing and Multiple Assignments Top 20 Bilingual MCQs with Answers

Q1. How does Python swap the values of two variables `a` and `b` in a single statement without a temporary variable?

(पायथन में बिना किसी अस्थायी (temporary) वेरिएबल के एक ही लाइन में `a` और `b` के मान कैसे बदले (swap) जाते हैं?)

(A) `a = b; b = a`

(B) `a <-> b`

(C) `swap(a, b)`

(D) `a, b = b, a`

Correct Answer: (D)

[EN] Python builds a right-hand tuple `(b, a)` first and then unpacks its elements into `a` and `b`.

[HI] `a, b = b, a` में पहले दाईं ओर `(b, a)` टपल बनता है और फिर वह बाईं ओर `a` व `b` में अनपैक हो जाता है।

Q2. What is the output of: `a = b = [1, 2]` `a.append(3)` `print(b)`

(`a = b = [1, 2]; a.append(3); print(b)` का आउटपुट क्या होगा?)

(A) `TypeError`

(B) `[1, 2]`

(C) `[1, 2, 3]`

(D) `[3]`

Correct Answer: (C)

[EN] Chained assignment binds both `a` and `b` to the exact same list object in memory, so mutating via `a` is visible through `b`.

[HI] चेन्ड असाइनमेंट में `a` और `b` एक ही लिस्ट ऑब्जेक्ट को पॉइंट करते हैं; इसलिए `a.append(3)` का असर `b` पर भी दिखता है।

Q3. What does `first, *rest = (10,)` assign to `rest`?

(`first, *rest = (10,)` लिखने पर `rest` का मान और डेटा टाइप क्या होगा?)

(A) `()` (an empty `tuple`)

(B) `ValueError: not enough values to unpack`

(C) `[]` (an empty `list`)

(D) `None`

Correct Answer: (C)

[EN] A starred unpacking target ALWAYS produces a `list`, even when unpacking a tuple and even when zero extra elements remain.

[HI] स्टार्ड अनपैकिंग टारगेट (`*rest`) हमेशा एक `list` बनाता है, चाहे दाईं ओर टपल हो या शून्य अतिरिक्त तत्व बचे हों (`[]`)।

Q4. What exception is raised if you execute `x, y = [1, 2, 3]` (without a starred target)?

(बिना स्टार (`*`) के `x, y = [1, 2, 3]` चलाने पर कौन-सा एक्सेप्शन उत्पन्न होता है?)

(A) `SyntaxError`

(B) `IndexError`

(C) `ValueError: too many values to unpack (expected 2)`

(D) `TypeError`

Correct Answer: (C)

[EN] When the number of left-hand targets differs from the iterable's element count, Python raises `ValueError`.

[HI] बाएँ वेरिएबल्स की संख्या और दाएँ तत्वों की संख्या अलग होने पर `ValueError` उत्पन्न होता है।

Q5. Which built-in function returns the unique memory address / object identity of a variable's referenced object in CPython?

(CPython में किसी वेरिएबल से जुड़े ऑब्जेक्ट का यूनिक पहचान नंबर (मेमोरी एड्रेस) किस बिल्ट-इन फंक्शन से मिलता है?)

(A) `id()`

(B) `addr()`

(C) `ptr()`

(D) `ref()`

Correct Answer: (A)

[EN] `id(obj)` returns an integer identifying the object uniquely during its lifetime (its memory address in CPython).

[HI] `id()` फंक्शन ऑब्जेक्ट के जीवनकाल में उसकी अद्वितीय पहचान संख्या (CPython में मेमोरी एड्रेस) लौटाता है।

Q6. What is the key difference between the `==` operator and the `is` operator in Python?

(पायथन में `==` और `is` ऑपरेटर के बीच मुख्य अंतर क्या है?)

(A) `==` compares memory addresses, while `is` compares values

(B) There is no difference; both are identical aliases

(C) `==` compares object values for equality, while `is` checks whether both names reference the exact same object (`id()`)

(D) `is` only works on integers, while `==` works only on strings

Correct Answer: (C)

[EN] `a == b` calls `__eq__` for value equality; `a is b` returns `id(a) == id(b)` (identity equality).

[HI] `==` दोनों ऑब्जेक्ट्स की वैल्यू की तुलना करता है, जबकि `is` यह जाँचता है कि क्या दोनों नाम एक ही मेमोरी ऑब्जेक्ट (`id()`) को पॉइंट कर रहे हैं।

Q7. What happens if you run `x = 10; del x; print(x)`?

(`x = 10; del x; print(x)` चलाने पर क्या होता है?)

(A) `ValueError`

(B) `NameError: name 'x' is not defined`

(C) Prints `None`

(D) Prints `0`

Correct Answer: (B)

[EN] `del x` removes the name `x` from the local/global namespace, so accessing `x` afterward raises `NameError`.

[HI] `del x` नेमस्पेस से वेरिएबल `x` का बाइंडिंग हटा देता है, जिससे आगे `print(x)` करने पर `NameError` आता है।

Q8. For which range of integers does CPython pre-allocate and intern singleton objects by default?

(CPython डिफ़ॉल्ट रूप से किस सीमा के पूर्णांकों (integers) को मेमोरी में प्री-एलोकेट (intern) करके रखता है?)

(A) `-128` to `127`

(B) `-32768` to `32767`

(C) `-5` to `256` (inclusive)

(D) `0` to `100`

Correct Answer: (C)

[EN] CPython caches small integers from `-5` through `256` at startup for performance, so `a = 256; b = 256; a is b` is `True`.

[HI] CPython परफॉर्मेंस के लिए `-5` से `256` तक के छोटे पूर्णांकों को पहले से कैश (intern) करता है।

Q9. What happens in Python when you write `x = 5` followed by `x = "Python"`?

(पायथन में `x = 5` लिखने के बाद `x = "Python"` लिखने पर क्या होता है?)

(A) Two variables named `x` exist simultaneously

(B) A `TypeError` occurs because `x` is already an `int`

(C) The integer `5` in memory is overwritten in place by text bytes

(D) `x` rebinds to a new `str` object, and the old `5` object has its reference count decremented

Correct Answer: (D)

[EN] Python variables hold references, not fixed storage; `x` simply switches to point at the new string object.

[HI] `x` अब नए `str` ऑब्जेक्ट की ओर पॉइंट करने लगता है और पुराने `5` ऑब्जेक्ट का रेफरेंस काउंट कम हो जाता है।

Q10. What is the output of: `a, *b, c = [1, 2]` `print(a, b, c)`

(`a, *b, c = [1, 2]; print(a, b, c)` का आउटपुट क्या होगा?)

(A) `1 [] 2`

(B) `1 2 []`

(C) `1 [2] None`

(D) `ValueError`

Correct Answer: (A)

[EN] `a` gets `1`, `c` gets `2`, and `*b` collects the zero remaining items as an empty list `[]`.

[HI] `a` को `1`, `c` को `2` मिलता है और बीच में कोई तत्व न बचने पर `*b` को खाली लिस्ट `[]` मिलती है।

Q11. Which Python 3.8+ operator (`:=`) allows assigning a value to a variable inside an expression?

(पायथन 3.8+ में कौन-सा ऑपरेटर (`:=`) किसी एक्सप्रेशन के भीतर ही वेरिएबल को मान असाइन करने की सुविधा देता है?)

(A) Slice operator

(B) Ternary operator

(C) Bitwise shift operator

(D) Walrus operator (assignment expression)

Correct Answer: (D)

[EN] The walrus operator (`:=`, PEP 572), e.g., `while (line := f.readline()):`, assigns and returns the value simultaneously.

[HI] ` :=` को वॉलरस ऑपरेटर (असाइनमेंट एक्सप्रेशन, PEP 572) कहा जाता है जो मान असाइन करके उसे एक्सप्रेशन में लौटाता है।

Q12. What is the output of: `x = 1 y = 2 x, y = y + 1, x + y print(x, y)`

(`x = 1; y = 2; x, y = y + 1, x + y; print(x, y)` का आउटपुट क्या होगा?)

(A) `1 2`

(B) `2 3`

(C) `3 3`

(D) `3 5`

Correct Answer: (C)

[EN] The entire RHS (`y + 1` = `3` and `x + y` = `1 + 2` = `3`) is evaluated using the OLD values of `x` and `y` before `x` and `y` are updated.

[HI] दाईं ओर के दोनों मान `y + 1` (3) और `x + y` (1 + 2 = 3) पुराने `x` व `y` से एक साथ निकलते हैं, इसलिए आउटपुट `3 3` आता है।

Q13. Can you write two starred targets in the same unpacking level, like `*a, *b = [1, 2, 3, 4]`?

(क्या एक ही अनपैकिंग स्तर पर दो स्टार्ड टारगेट (`*a, *b = [1, 2, 3, 4]`) लिखे जा सकते हैं?)

(A) Yes; `a` gets all items and `b` gets `[]`

(B) Yes; it splits the list evenly (`[1, 2]` and `[3, 4]`)

(C) No; it raises `SyntaxError: multiple starred expressions in assignment`

(D) It raises `ValueError` at runtime

Correct Answer: (C)

[EN] At most ONE starred expression is allowed per unpacking target tuple to avoid ambiguous splitting.

[HI] अस्पष्टता से बचने के लिए एक अनपैकिंग स्तर पर अधिकतम एक ही `*` टारगेट मान्य है; दो लिखने पर `SyntaxError` आता है।

Q14. Which function is recommended to check whether `x` is an integer, even if `x` is a `bool` subclass?

(यह जाँचने के लिए कौन-सा फंक्शन अनुशंसित है कि `x` एक `int` (या उसकी सब-क्लास) है?)

(A) `isinstance(x, int)`

(B) `is_int(x)`

(C) `id(x) == int`

(D) `typeof(x) == 'int'`

Correct Answer: (A)

[EN] `isinstance(x, int)` checks class and subclass relationships cleanly (`isinstance(True, int)` is `True`).

[HI] `isinstance(x, int)` इनहेरिटेंस का भी ध्यान रखते हुए सुरक्षित रूप से टाइप जाँचता है (`isinstance(True, int)` भी `True` होता है)।

Q15. What happens with `a = [1, 2]; b = a; a = [3, 4]`—what does `print(b)` output?

(`a = [1, 2]; b = a; a = [3, 4]` चलाने के बाद `print(b)` क्या प्रिंट करेगा?)

(A) `[3, 4]`

(B) `[1, 2]`

(C) `[]`

(D) `NameError`

Correct Answer: (B)

[EN] `a = [3, 4]` rebinds ONLY the name `a` to a brand-new list; `b` still holds its reference to the original `[1, 2]` list.

[HI] `a = [3, 4]` केवल `a` का रेफरेंस बदलकर नई लिस्ट से जोड़ता है; `b` अभी भी पुरानी `[1, 2]` लिस्ट को ही पॉइंट करता है।

Q16. Which statement about Python variables and assignments is NOT true?

(पायथन वेरिएबल्स और असाइनमेंट्स के बारे में निम्नलिखित में से कौन-सा कथन सत्य नहीं है?)

(A) A variable must be declared with `var` or `int` before its first assignment

(B) Variables store references to objects on the Python heap

(C) Multiple assignment `a, b = b, a` swaps values cleanly

(D) Reassigning `a` to a new object does not alter other variables still referencing the old object

Correct Answer: (A)

[EN] Python has no variable declaration keyword (`var`/`let`/`int`); a variable is created automatically upon assignment.

[HI] पायथन में वेरिएबल बनाने से पहले `var` या `int` घोषित करने की आवश्यकता नहीं होती; मान असाइन करते ही वेरिएबल बन जाता है।

Q17. Within Python Variables: Dynamic Typing and Multiple Assignments, which assignment form directly maps to: "x = 5; x = 'hi'"?

(Python Variables: Dynamic Typing and Multiple Assignments में कौन सा Assignment Form सीधे "x = 5; x = 'hi'" से संबंधित है?)

(A) Starred Unpacking

(B) Chained Assignment

(C) Dynamic Rebinding

(D) Parallel Tuple Swap

Correct Answer: (C)

[EN] In Python Variables: Dynamic Typing and Multiple Assignments, 'Dynamic Rebinding' handles 'x = 5; x = 'hi'' (Same name binds to new heap object & type).

[HI] Python Variables: Dynamic Typing and Multiple Assignments में 'Dynamic Rebinding' का कार्य/विवरण 'x = 5; x = 'hi'' (Same name binds to new heap object & type) है।

Q18. Which option accurately describes 'Chained Assignment' in Python Variables: Dynamic Typing and Multiple Assignments?

(Python Variables: Dynamic Typing and Multiple Assignments के संदर्भ में 'Chained Assignment' की सही विशेषता कौन सी है?)

(A) a, b = b, a

(B) a = b = []

(C) h, *m, t = [1,2,3,4]

(D) x = 5; x = 'hi'

Correct Answer: (B)

[EN] 'Chained Assignment' provides 'a = b = []' — key point: All targets alias single object (careful with mutables).

[HI] 'Chained Assignment' का मुख्य विवरण 'a = b = []' है (All targets alias single object (careful with mutables))।

Q19. In Python Variables: Dynamic Typing and Multiple Assignments, identify the correct parameter for the specification: "a, b = b, a".

(Python Variables: Dynamic Typing and Multiple Assignments में "a, b = b, a" विवरण किस विकल्प के लिए सही है?)

(A) Chained Assignment

(B) Dynamic Rebinding

(C) Parallel Tuple Swap

(D) Starred Unpacking

Correct Answer: (C)

[EN] 'Parallel Tuple Swap' corresponds to 'a, b = b, a' (Evaluates RHS tuple before LHS binding; no temp var).

[HI] 'Parallel Tuple Swap' का संबंध 'a, b = b, a' (Evaluates RHS tuple before LHS binding; no temp var) से है।

Q20. Considering Python Variables: Dynamic Typing and Multiple Assignments, what key behavior defines 'Starred Unpacking'?

(Python Variables: Dynamic Typing and Multiple Assignments में 'Starred Unpacking' की मुख्य भूमिका या मान क्या है?)

(A) x = 5; x = 'hi'

(B) h, *m, t = [1,2,3,4]

(C) a, b = b, a

(D) a = b = []

Correct Answer: (B)

[EN] 'Starred Unpacking' represents 'h, *m, t = [1,2,3,4]' (Starred target always produces a list (m=[2,3])).

[HI] 'Starred Unpacking' का अर्थ/मान 'h, *m, t = [1,2,3,4]' है (Starred target always produces a list (m=[2,3]))।

Python Variables: Dynamic Typing and Multiple Assignments — Exam FAQs

Q1: Does Python pass arguments to functions by value or by reference?

पायथन में फंक्शन्स को आर्गुमेंट्स कॉल-बाय-वैल्यू से पास होते हैं या कॉल-बाय-रेफरेंस से?

[EN] Python uses 'call-by-object-reference' (pass-by-assignment): a reference to the object is passed. Mutating a mutable object (`list.append`) affects the caller's object, whereas reassigning the parameter (`x = 99`) only rebinds the local parameter name.

[HI] पायथन 'कॉल-बाय-ऑब्जेक्ट-रेफरेंस' का उपयोग करता है: म्यूटेबल ऑब्जेक्ट (`list`) में इन-प्लेस बदलाव बाहर भी दिखता है, पर पैरामीटर को नया मान देने (`x = 99`) से बाहरी वेरिएबल नहीं बदलता।

Q2: Why did `a = 1000; b = 1000; a is b` sometimes print `False` in the interactive shell while `a = 10; b = 10; a is b` prints `True`?

इंटरैक्टिव शेल में `a = 10; b = 10; a is b` `True` देता है, पर `a = 1000; b = 1000; a is b` कभी-कभी `False` क्यों देता है?

[EN] CPython only guarantees singleton caching (interning) for integers from `-5` to `256`. Always use `==` to compare numbers and reserve `is` for `None` or object identity.

[HI] CPython केवल `-5` से `256` तक के पूर्णांकों को हमेशा इंटरन करता है। संख्याओं की तुलना हमेशा `==` से करें और `is` केवल `None` या मेमोरी पहचान के लिए रखें।

Q3: How do you create a truly independent copy of a list instead of an alias?

किसी लिस्ट का केवल एलियास बनाने के बजाय उसकी स्वतंत्र कॉपी कैसे बनाते हैं?

[EN] Use `b = a.copy()`, `b = a[:]`, or `b = list(a)` for a shallow copy, or `copy.deepcopy(a)` when the list contains nested mutable objects.

[HI] शैलो कॉपी के लिए `a.copy()`, `a[:]` या `list(a)` का उपयोग करें, और नेस्टेड लिस्ट्स के लिए `copy.deepcopy(a)` का उपयोग करें।

Related Posts

  • Loading related posts...

Post a Comment

Search Topic Notes & 20 MCQs (Hindi / English)