Literals in Python (पायथन में लिटरल्स) :-
Literal (लिटरल) वह निश्चित (Fixed) Value (मान) होती है जिसे Programmer Program में सीधे (Directly) लिखता है। Literal किसी Variable (वैरिएबल) का नाम नहीं होता, बल्कि वह वास्तविक (Actual) Data होता है जिसे Program में उपयोग किया जाता है।
जब भी हम किसी संख्या, शब्द, सत्य/असत्य (True/False) या किसी Collection (संग्रह) को सीधे Program में लिखते हैं, तो उसे Literal कहा जाता है।
उदाहरण के लिए, 10, 3.14, "Python" और True सभी Literals हैं।
English
A Literal is a fixed value written directly in the source code by the programmer. It is the actual data used in a program, not the name of a variable.
Whenever we write a number, text, Boolean value, or collection directly in a program, it is called a Literal.
For example, 10, 3.14, "Python", and True are all literals.
Example (उदाहरण) -
Python में मुख्य रूप से निम्न प्रकार के Literals होते हैं—

जो Literals संख्याओं (Numbers) को दर्शाते हैं, उन्हें Numeric Literals कहते हैं।
Literals that represent numbers are called Numeric Literals.
Numeric Literals चार प्रकार के होते हैं—
Integer Literal वे संख्याएँ होती हैं जिनमें कोई दशमलव (Decimal Point) नहीं होता।
An Integer Literal is a whole number without a decimal point.
ExampleFloat Literal वे संख्याएँ होती हैं जिनमें दशमलव (Decimal Point) होता है।
A Float Literal is a number that contains a decimal point.
Example-Complex Number में वास्तविक (Real) और काल्पनिक (Imaginary) भाग होता है। Python में Imaginary Part के लिए j का उपयोग किया जाता है।
A Complex Literal consists of a real part and an imaginary part. Python uses j for the imaginary part.
Example-Binary Number केवल 0 और 1 से बनता है तथा 0b या 0B से शुरू होता है।
A Binary Literal starts with 0b or 0B and contains only 0 and 1.
Example -(e) Octal Literal (ऑक्टल लिटरल) :-
Octal Number 0o या 0O से शुरू होता है और इसमें केवल 0–7 अंक होते हैं।
An Octal Literal starts with 0o or 0O and contains digits from 0 to 7.
Example -Hexadecimal Number 0x या 0X से शुरू होता है।
इसमें 0–9 तथा A–F अक्षरों का उपयोग किया जाता है।
A Hexadecimal Literal starts with 0x or 0X and uses digits 0–9 and letters A–F.
Example-Quotes (' ' या " ") के अंदर लिखे गए Characters (अक्षरों) के समूह को String Literal कहते हैं।
A String Literal is a sequence of characters enclosed in single or double quotes.
Example-Boolean Literal केवल दो Values रखता है
Boolean Literals have only two values:
इनका उपयोग Conditions में किया जाता है।
They are used in conditions and logical operations.
None एक विशेष (Special) Literal है जो किसी Value के न होने (No Value) को दर्शाता है।
None is a special literal that represents the absence of a value.
Example-data = None
5. Collection Literals (कलेक्शन लिटरल):-Collection Literal (कलेक्शन लिटरल) वह Literal होता है जिसका उपयोग एक से अधिक Values (मानों) को एक ही Object (ऑब्जेक्ट) में Store (संग्रहित) करने के लिए किया जाता है।
EnglishA Collection Literal is a literal used to store multiple values in a single object.
Types of Collection Literals (कलेक्शन लिटरल के प्रकार) -Python में मुख्य रूप से चार (4) प्रकार के Collection Literals होते हैं—
List Literal का उपयोग कई Values को Square Brackets [ ] के अंदर Store करने के लिए किया जाता है।
A List Literal stores multiple values inside Square Brackets [ ].
numbers = [10, 20, 30, 40]
2. Tuple Literal (टपल लिटरल) -Tuple Literal का उपयोग कई Values को Parentheses ( ) के अंदर Store करने के लिए किया जाता है।
A Tuple Literal stores multiple values inside Parentheses ( ).
marks = (85, 90, 95)
3. Set Literal (सेट लिटरल) -Set Literal का उपयोग कई Unique (अद्वितीय) Values को Curly Braces { } के अंदर Store करने के लिए किया जाता है।
A Set Literal stores unique values inside Curly Braces { }.
colors = {"Red", "Green", "Blue"}
4. Dictionary Literal (डिक्शनरी लिटरल) -Dictionary Literal का उपयोग Key–Value Pair (कुंजी–मान युग्म) के रूप में Data Store करने के लिए किया जाता है।
इसे Curly Braces { } के अंदर लिखा जाता है।
A Dictionary Literal stores data as Key–Value Pairs.
It is written inside Curly Braces { }.