Python History, Guido van Rossum and Python 2 vs Python 3 Notes in Hindi & English : पायथन का इतिहास, गुइडो वैन रोसुम (1991) और पायथन 2 बनाम 3 और 20 महत्वपूर्ण MCQ प्रश्न (Rajasthan IT Exam)

Post a Comment

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

Overview: Python was designed by Guido van Rossum at CWI in the Netherlands starting in late 1989 and first released publicly in February 1991 (v0.9.0) as a successor to the ABC programming language. Python 3 (released December 2008) broke backward compatibility with Python 2 (EOL January 1, 2020) to unify Unicode strings, make print a function, and introduce true floating-point division.

अध्याय सार: पायथन का निर्माण नीदरलैंड्स के CWI संस्थान में गुइडो वैन रोसुम द्वारा दिसंबर 1989 में ABC भाषा के उत्तराधिकारी के रूप में शुरू किया गया और फरवरी 1991 में इसका पहला वर्जन (0.9.0) जारी हुआ। पायथन 3 (दिसंबर 2008) ने पायथन 2 (EOL 1 जनवरी 2020) की कमियों को दूर करते हुए डिफ़ॉल्ट Unicode `str`, `print()` फंक्शन और फ्लोट डिवीजन `/` जैसे महत्वपूर्ण बदलाव किए।

Python History, Guido van Rossum and Python 2 vs Python 3: Detailed Notes & Architecture (पायथन का इतिहास, गुइडो वैन रोसुम (1991) और पायथन 2 बनाम 3)

1. Origins and Guido van Rossum (1989-1991) (पायथन का उद्भव और गुइडो वैन रोसुम (1989-1991))

[EN] Guido van Rossum began implementing Python in December 1989 at Centrum Wiskunde & Informatica (CWI) in Amsterdam as a hobby Christmas project to replace the teaching language ABC while interfacing with the Amoeba OS. He released Python 0.9.0 publicly in February 1991 on Usenet (`alt.sources`), already featuring classes with inheritance, exception handling, functions, and core types (`list`, `dict`, `str`). Rather than the snake, Python was named after the BBC comedy series 'Monty Python's Flying Circus', and Guido served as BDFL (Benevolent Dictator For Life) until July 2018.

[HI] गुइडो वैन रोसुम ने दिसंबर 1989 में नीदरलैंड्स के CWI (Centrum Wiskunde & Informatica) में ABC भाषा के विकल्प और Amoeba OS के साथ कार्य करने हेतु पायथन बनाना शुरू किया। फरवरी 1991 में पहला सार्वजनिक वर्जन Python 0.9.0 रिलीज हुआ, जिसमें पहले से क्लासेस, एक्सेप्शन हैंडलिंग, `list`, `dict` और `str` मौजूद थे। इसका नाम साँप के बजाय कॉमेडी शो 'Monty Python's Flying Circus' पर रखा गया, और जुलाई 2018 तक गुइडो इसके BDFL रहे।

2. Major Release Milestones and Python Philosophy (प्रमुख वर्जन माइलस्टोन और पायथन का दर्शन)

[EN] Python 1.0 arrived in January 1994 with functional tools (`lambda`, `map`, `filter`, `reduce`), followed by Python 2.0 in October 2000 introducing list comprehensions, Unicode support, and a cycle-detecting garbage collector. Python 3.0 ('Python 3000' or 'Py3k') launched on December 3, 2008 to clean up legacy design flaws; official support for Python 2.7 ended on January 1, 2020 (final bugfix 2.7.18 in April 2020). Python's guiding design principles are documented in PEP 20 ('The Zen of Python') written by Tim Peters and viewable via `import this`.

[HI] जनवरी 1994 में Python 1.0 (`lambda`, `map`, `filter` के साथ) और अक्टूबर 2000 में Python 2.0 (लिस्ट कॉम्प्रिहेंशन व साइकल-डिटेक्टिंग गार्बेज कलेक्टर के साथ) जारी हुए। पुरानी खामियों को सुधारने के लिए 3 दिसंबर 2008 को Python 3.0 ('Py3k') आया, जबकि Python 2.7 का आधिकारिक सपोर्ट 1 जनवरी 2020 को समाप्त (EOL) हो गया। पायथन के डिजाइन सिद्धांत Tim Peters द्वारा लिखे गए PEP 20 ('The Zen of Python') में संकलित हैं, जिन्हें `import this` से देखा जा सकता है।

3. Core Syntax Changes: Python 2 vs Python 3 (मुख्य सिंटैक्स अंतर: पायथन 2 बनाम पायथन 3)

[EN] In Python 2, `print` was a keyword statement (`print "Hello"`), whereas in Python 3 `print()` is a standard built-in function requiring parentheses (`print("Hello")`). Division `/` changed drastically: `5 / 2` evaluated to integer `2` in Python 2, whereas Python 3 performs true float division (`5 / 2 == 2.5`) and reserves `//` for floor division (`5 // 2 == 2`). Exception handling changed from `except ValueError, e:` in Python 2 to `except ValueError as e:` in Python 3, removing ambiguity when catching multiple exception tuples.

[HI] पायथन 2 में `print` एक स्टेटमेंट था (`print "Hello"`), जिसे पायथन 3 में बिल्ट-इन फंक्शन `print("Hello")` बना दिया गया। भाग (division) का नियम भी बदला: पायथन 2 में `5 / 2` का उत्तर `2` (इंटीजर) था, जबकि पायथन 3 में `5 / 2 == 2.5` (ट्रू फ्लोट डिवीजन) होता है और फ्लोर डिवीजन के लिए `//` उपयोग होता है। एक्सेप्शन पकड़ने का तरीका भी `except Exception, e:` से बदलकर `except Exception as e:` हो गया।

4. Strings, Input, and Iterator Enhancements (स्ट्रिंग्स, इनपुट और इटरेटर में सुधार)

[EN] Python 2 stored `str` as raw 8-bit ASCII bytes and required `u"..."` for Unicode, while Python 3 treats all `str` literals as Unicode (UTF-8 source encoding by default) and isolates binary data in `bytes`. Python 2's `range()` constructed a full `list` in memory alongside `xrange()` for lazy iteration; Python 3 removed `xrange()` and upgraded `range()` (plus `keys()`, `map()`, `zip()`) to memory-efficient lazy views/iterators. Input was also streamlined: Python 2's unsafe `input()` (which evaluated expressions like `eval()`) was dropped, and `raw_input()` was renamed to `input()` in Python 3, always returning a `str`.

[HI] पायथन 2 में `str` डिफ़ॉल्ट रूप से 8-बिट ASCII बाइट्स थी और Unicode के लिए `u"..."` लिखना पड़ता था; पायथन 3 में सभी `str` डिफ़ॉल्ट रूप से Unicode हैं और बाइनरी डेटा `bytes` में रहता है। पायथन 2 में `range()` पूरी लिस्ट मेमोरी में बनाता था और `xrange()` लेजी था; पायथन 3 में `xrange()` हटाकर `range()` को ही लेजी मेमोरी-एफिशिएंट बना दिया गया। पायथन 2 के `raw_input()` को पायथन 3 में `input()` नाम दिया गया जो हमेशा `str` लौटाता है।

Syntax, Formula & Technical Example (Python History, Guido van Rossum and Python 2 vs Python 3)

# Python 3 behavior vs legacy Python 2
import sys
print("Version:", sys.version_info.major)
print(7 / 2)    # 3.5 (True division; Python 2 gave 3)
print(7 // 2)   # 3   (Floor division)
for i in range(3):   # Lazy range object (like Py2 xrange)
    print(type("अ"), i)  # str is Unicode by default

Python History, Guido van Rossum and Python 2 vs Python 3 Quick Reference & Comparison Table

Feature / ConstructPython 2 BehaviorPython 3 Behavior
print syntaxStatement: print 'hi'Built-in function: print('hi')
Division 5 / 22 (integer floor division)2.5 (true float division; // for floor)
Default str typeASCII 8-bit bytes; separate unicodeUnicode text; separate bytes type
range() vs xrange()range() builds list; xrange() lazyxrange() removed; range() is lazy

Python History, Guido van Rossum and Python 2 vs Python 3 Top 20 Bilingual MCQs with Answers

Q1. Who created Python and in which year was its first public version (0.9.0) released?

(पायथन का निर्माण किसने किया और इसका पहला सार्वजनिक वर्जन (0.9.0) किस वर्ष जारी हुआ?)

(A) James Gosling, 1995

(B) Dennis Ritchie, 1972

(C) Guido van Rossum, 1991

(D) Bjarne Stroustrup, 1985

Correct Answer: (C)

[EN] Guido van Rossum started developing Python in late 1989 at CWI and released Python 0.9.0 in February 1991.

[HI] गुइडो वैन रोसुम ने दिसंबर 1989 में CWI में पायथन पर काम शुरू किया और फरवरी 1991 में पहला सार्वजनिक वर्जन 0.9.0 जारी किया।

Q2. At which research institute did Guido van Rossum develop Python, and which earlier language directly inspired it?

(गुइडो वैन रोसुम ने किस संस्थान में पायथन विकसित किया और यह किस पुरानी भाषा से प्रेरित था?)

(A) CWI (Netherlands), inspired by the ABC language

(B) MIT (USA), inspired by Lisp

(C) ETH Zurich, inspired by Pascal

(D) Bell Labs (USA), inspired by C

Correct Answer: (A)

[EN] Python was created at Centrum Wiskunde & Informatica (CWI) in Amsterdam as a successor to the ABC teaching language.

[HI] पायथन को एम्स्टर्डम के CWI संस्थान में ABC भाषा के उत्तराधिकारी के रूप में विकसित किया गया था।

Q3. What inspired the name 'Python' for the programming language?

(प्रोग्रामिंग भाषा 'Python' का नाम किससे प्रेरित होकर रखा गया?)

(A) A Greek mythological river

(B) An acronym for 'Portable High-speed Tool'

(C) The Indian rock python snake species

(D) The British comedy show 'Monty Python's Flying Circus'

Correct Answer: (D)

[EN] Guido van Rossum was reading published scripts from 'Monty Python's Flying Circus' while developing the language.

[HI] गुइडो वैन रोसुम इसे बनाते समय BBC कॉमेडी शो 'Monty Python's Flying Circus' की स्क्रिप्ट पढ़ रहे थे, न कि साँप के नाम पर।

Q4. What does `print(5 / 2)` output in Python 3 compared to Python 2?

(पायथन 2 की तुलना में पायथन 3 में `print(5 / 2)` का आउटपुट क्या होता है?)

(A) 2.5 in Python 3 (whereas Python 2 gave 2)

(B) 2 in Python 3 (whereas Python 2 gave 2.5)

(C) TypeError in Python 3

(D) 2.5 in both Python 2 and Python 3

Correct Answer: (A)

[EN] Python 3 changed `/` on integers to always return a float (true division), using `//` for floor division.

[HI] पायथन 3 में `/` हमेशा ट्रू फ्लोट डिवीजन (`2.5`) करता है, जबकि पायथन 2 में दो इंटीजर पर यह `2` देता था।

Q5. Which Python 2 function was removed in Python 3 because `range()` itself became lazy?

(पायथन 3 में कौन-सा फंक्शन हटा दिया गया क्योंकि `range()` स्वयं ही लेजी (मेमोरी-एफिशिएंट) बन गया?)

(A) `enumerate()`

(B) `len()`

(C) `xrange()`

(D) `zip()`

Correct Answer: (C)

[EN] In Python 2, `range()` allocated a full list while `xrange()` yielded items lazily; Python 3 renamed that lazy behavior to `range()` and removed `xrange()`.

[HI] पायथन 2 में `xrange()` लेजी इटरेटर था और `range()` लिस्ट बनाता था; पायथन 3 में `xrange()` हटाकर `range()` को ही लेजी कर दिया गया।

Q6. When did Python 2.7 officially reach End-of-Life (EOL)?

(पायथन 2.7 आधिकारिक रूप से End-of-Life (EOL) कब हुआ?)

(A) December 3, 2008

(B) January 1, 2015

(C) December 31, 2023

(D) January 1, 2020

Correct Answer: (D)

[EN] Python 2.7 reached official End-of-Life on January 1, 2020, receiving its final release (2.7.18) in April 2020.

[HI] पायथन 2.7 का आधिकारिक सपोर्ट 1 जनवरी 2020 को समाप्त (EOL) हुआ था।

Q7. How did Python 3 handle `raw_input()` and `input()` from Python 2?

(पायथन 3 ने पायथन 2 के `raw_input()` और `input()` को किस प्रकार बदला?)

(A) Both `input()` and `raw_input()` were removed

(B) `raw_input()` now returns an `int` by default

(C) `raw_input()` was renamed to `input()`, which always returns a `str`

(D) `input()` still calls `eval()` automatically in Python 3

Correct Answer: (C)

[EN] Python 2's `input()` evaluated user text as Python code (a security risk); Python 3 removed it and renamed safe `raw_input()` to `input()`.

[HI] पायथन 2 का `raw_input()` पायथन 3 में `input()` बन गया है जो सुरक्षित रूप से हमेशा `str` लौटाता है, जबकि पुराना `eval`-आधारित `input()` हटा दिया गया।

Q8. What is the default internal text representation of `str` in Python 3?

(पायथन 3 में `str` डेटा टाइप डिफ़ॉल्ट रूप से किस कैरेक्टर एन्कोडिंग पर आधारित होता है?)

(A) Unicode

(B) 7-bit ASCII only

(C) Binary `bytes` without encoding

(D) EBCDIC

Correct Answer: (A)

[EN] Python 3 makes all `str` objects Unicode strings and separates raw binary sequences into `bytes`.

[HI] पायथन 3 में सभी `str` ऑब्जेक्ट डिफ़ॉल्ट रूप से Unicode होते हैं, जबकि रॉ बाइनरी डेटा के लिए अलग `bytes` टाइप है।

Q9. Which statement runs 'The Zen of Python' (PEP 20) in a Python interpreter?

(पायथन इंटरप्रेटर में 'The Zen of Python' (PEP 20) देखने के लिए कौन-सा स्टेटमेंट लिखा जाता है?)

(A) `help(pep20)`

(B) `import guido`

(C) `import this`

(D) `import zen`

Correct Answer: (C)

[EN] Executing `import this` prints Tim Peters' 19 aphorisms summarizing Python's design philosophy.

[HI] `import this` चलाने पर टिम पीटर्स द्वारा लिखा गया PEP 20 ('The Zen of Python') स्क्रीन पर प्रिंट होता है।

Q10. Which Python 3 exception-catching syntax replaced Python 2's `except ValueError, e:`?

(पायथन 2 के `except ValueError, e:` की जगह पायथन 3 में कौन-सा सिंटैक्स उपयोग होता है?)

(A) `except ValueError as e:`

(B) `catch ValueError e:`

(C) `except ValueError -> e:`

(D) `except (ValueError; e):`

Correct Answer: (A)

[EN] Python 3 requires the `as` keyword in `except` clauses so commas only separate tuples of exception types.

[HI] पायथन 3 में एक्सेप्शन वेरिएबल बाइंड करने के लिए `as` कीवर्ड (`except ValueError as e:`) अनिवार्य है।

Q11. In Python 2 vs Python 3, what happened to the separate `long` integer type (`123L`)?

(पायथन 2 के अलग `long` इंटीजर टाइप (`123L`) के साथ पायथन 3 में क्या हुआ?)

(A) `long` was renamed to `bigint`

(B) `int` was capped at 64 bits and `long` became mandatory

(C) `long` was merged into a single arbitrary-precision `int` type (no `L` suffix)

(D) `123L` became a complex number

Correct Answer: (C)

[EN] Python 3 unified `int` and `long` into one arbitrary-precision `int` class and dropped the `L` literal suffix.

[HI] पायथन 3 में `int` और `long` को मिलाकर एक असीमित-आकार का `int` बना दिया गया और `L` सफिक्स हटा दिया गया।

Q12. What does `sys.maxsize` vs `int` precision signify in Python 3?

(पायथन 3 में `sys.maxsize` की तुलना में `int` की सीमा क्या होती है?)

(A) `int` is strictly 64-bit signed

(B) `int` converts to `float` above `sys.maxsize`

(C) `int` has arbitrary precision limited only by RAM, unlike fixed 32/64-bit C integers

(D) `int` overflows silently at `2**31 - 1`

Correct Answer: (C)

[EN] Python 3 `int` objects dynamically allocate memory words as needed, preventing integer overflow.

[HI] पायथन 3 में `int` का आकार असीमित होता है और उपलब्ध RAM तक कितनी भी बड़ी संख्या स्टोर कर सकता है।

Q13. Which official tool accompanied Python 3 migration to automatically translate Python 2 source code to Python 3?

(पायथन 2 कोड को स्वतः पायथन 3 में बदलने के लिए कौन-सा आधिकारिक टूल साथ में आता था?)

(A) `cythonize`

(B) `2to3`

(C) `pip23`

(D) `pyconvert`

Correct Answer: (B)

[EN] `2to3` reads Python 2 source files and applies fixers for print, xrange, exceptions, and imports to produce Python 3 code.

[HI] `2to3` टूल पायथन 2 की फाइलों को स्कैन करके `print()`, `range()`, एक्सेप्शन आदि को पायथन 3 सिंटैक्स में बदलता है।

Q14. In Python 3, what type does `dict.keys()` return compared to Python 2?

(पायथन 2 की तुलना में पायथन 3 में `dict.keys()` क्या लौटाता है?)

(A) A `None` generator

(B) A `tuple` of keys

(C) A dynamic dictionary view object (`dict_keys`), rather than a static `list`

(D) A sorted `set` copy

Correct Answer: (C)

[EN] Python 3 returns a memory-efficient view object reflecting live dictionary changes without copying all keys into a list.

[HI] पायथन 3 में `dict.keys()` पूरी `list` बनाने के बजाय एक डायनामिक व्यू ऑब्जेक्ट (`dict_keys`) लौटाता है।

Q15. When was Python 3.0 officially released?

(पायथन 3.0 आधिकारिक रूप से कब जारी किया गया था?)

(A) January 1, 2020

(B) February 20, 1991

(C) December 3, 2008

(D) October 16, 2000

Correct Answer: (C)

[EN] Python 3.0 was released on December 3, 2008, while 1991 was 0.9.0, 2000 was 2.0, and 2020 was Python 2 EOL.

[HI] पायथन 3.0 (Python 3000) 3 दिसंबर 2008 को जारी किया गया था।

Q16. Which statement about Python's history and Python 2 vs Python 3 is NOT true?

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

(A) `next(it)` replaced the Python 2 `it.next()` method

(B) Guido van Rossum created Python at CWI in the Netherlands

(C) Python 3 changed `print` from a statement to a function

(D) Python 3 is 100% backward-compatible with all Python 2 code without modification

Correct Answer: (D)

[EN] Python 3 was intentionally designed as a backward-incompatible major release to fix foundational Python 2 flaws like `print`, division, and string encoding.

[HI] पायथन 3 जानबूझकर बैकवर्ड-कम्पैटिबल नहीं बनाया गया था ताकि पायथन 2 की पुरानी कमियों (`print`, डिवीजन, स्ट्रिंग एन्कोडिंग) को सुधारा जा सके।

Q17. Within Python History, Guido van Rossum and Python 2 vs Python 3, which feature / construct directly maps to: "Statement: print 'hi'"?

(Python History, Guido van Rossum and Python 2 vs Python 3 में कौन सा Feature / Construct सीधे "Statement: print 'hi'" से संबंधित है?)

(A) Default str type

(B) print syntax

(C) Division 5 / 2

(D) range() vs xrange()

Correct Answer: (B)

[EN] In Python History, Guido van Rossum and Python 2 vs Python 3, 'print syntax' handles 'Statement: print 'hi'' (Built-in function: print('hi')).

[HI] Python History, Guido van Rossum and Python 2 vs Python 3 में 'print syntax' का कार्य/विवरण 'Statement: print 'hi'' (Built-in function: print('hi')) है।

Q18. Which option accurately describes 'Division 5 / 2' in Python History, Guido van Rossum and Python 2 vs Python 3?

(Python History, Guido van Rossum and Python 2 vs Python 3 के संदर्भ में 'Division 5 / 2' की सही विशेषता कौन सी है?)

(A) range() builds list; xrange() lazy

(B) 2 (integer floor division)

(C) Statement: print 'hi'

(D) ASCII 8-bit bytes; separate unicode

Correct Answer: (B)

[EN] 'Division 5 / 2' provides '2 (integer floor division)' — key point: 2.5 (true float division; // for floor).

[HI] 'Division 5 / 2' का मुख्य विवरण '2 (integer floor division)' है (2.5 (true float division; // for floor))।

Q19. In Python History, Guido van Rossum and Python 2 vs Python 3, identify the correct parameter for the specification: "ASCII 8-bit bytes; separate unicode".

(Python History, Guido van Rossum and Python 2 vs Python 3 में "ASCII 8-bit bytes; separate unicode" विवरण किस विकल्प के लिए सही है?)

(A) Division 5 / 2

(B) print syntax

(C) Default str type

(D) range() vs xrange()

Correct Answer: (C)

[EN] 'Default str type' corresponds to 'ASCII 8-bit bytes; separate unicode' (Unicode text; separate bytes type).

[HI] 'Default str type' का संबंध 'ASCII 8-bit bytes; separate unicode' (Unicode text; separate bytes type) से है।

Q20. Considering Python History, Guido van Rossum and Python 2 vs Python 3, what key behavior defines 'range() vs xrange()'?

(Python History, Guido van Rossum and Python 2 vs Python 3 में 'range() vs xrange()' की मुख्य भूमिका या मान क्या है?)

(A) range() builds list; xrange() lazy

(B) Statement: print 'hi'

(C) 2 (integer floor division)

(D) ASCII 8-bit bytes; separate unicode

Correct Answer: (A)

[EN] 'range() vs xrange()' represents 'range() builds list; xrange() lazy' (xrange() removed; range() is lazy).

[HI] 'range() vs xrange()' का अर्थ/मान 'range() builds list; xrange() lazy' है (xrange() removed; range() is lazy)।

Python History, Guido van Rossum and Python 2 vs Python 3 — Exam FAQs

Q1: Why did Python 3 break backward compatibility with Python 2?

पायथन 3 ने पायथन 2 के साथ बैकवर्ड कम्पैटिबिलिटी क्यों तोड़ी?

[EN] To fix deep architectural flaws—such as ambiguous ASCII/Unicode text vs bytes, `print` being a keyword statement, and `/` integer truncation—that could not be repaired safely within Python 2.

[HI] ASCII/Unicode स्ट्रिंग्स के भ्रम, `print` स्टेटमेंट की सीमा और `/` द्वारा पूर्णांक भाग जैसी मूल खामियों को ठीक करने के लिए पायथन 3 में ब्रेक करना आवश्यक था।

Q2: What does BDFL stand for in Python's history?

पायथन के इतिहास में BDFL का क्या अर्थ है?

[EN] Benevolent Dictator For Life—a title given to Guido van Rossum as Python's lead language designer until he stepped down in July 2018 (replaced by a 5-member Steering Council).

[HI] Benevolent Dictator For Life—यह उपाधि गुइडो वैन रोसुम को दी गई थी; जुलाई 2018 में उनके हटने के बाद 5-सदस्यीय Steering Council निर्णय लेती है।

Q3: Can Python 2 code still run using `__future__` imports in Python 2.7?

क्या पायथन 2.7 में `__future__` इम्पोर्ट करके पायथन 3 जैसे फीचर्स इस्तेमाल किए जा सकते थे?

[EN] Yes; `from __future__ import division, print_function` enabled Python 3 division and `print()` syntax inside Python 2 scripts to ease migration.

[HI] हाँ; पायथन 2 में `from __future__ import division, print_function` लिखकर पायथन 3 जैसा डिवीजन और `print()` व्यवहार उपयोग किया जा सकता था।

Related Posts

  • Loading related posts...

Post a Comment

Search Topic Notes & 20 MCQs (Hindi / English)