Statements in Python (पायथन में स्टेटमेंट्स) :-
Statement (स्टेटमेंट) वह निर्देश (Instruction) होता है जिसे Python Interpreter पढ़कर Execute (निष्पादित) करता है।
दूसरे शब्दों में, Python Program में लिखा गया प्रत्येक ऐसा Code जो कोई कार्य करता है, उसे Statement कहा जाता है।
एक Python Program कई Statements का समूह होता है। Interpreter इन Statements को एक-एक करके पढ़ता है और उनके अनुसार कार्य करता है।
English
A Statement is an instruction that the Python interpreter reads and executes.
In other words, any line of code that performs an action in a Python program is called a statement.
A Python program consists of one or more statements. The Python interpreter executes these statements one by one.
Example (उदाहरण) :-
Python में मुख्य रूप से निम्न प्रकार के Statements होते हैं—
Compound Statements के अंतर्गत कई प्रकार के Statements आते हैं।
1. Simple Statement (सरल स्टेटमेंट) :-जो Statement केवल एक कार्य करता है और सामान्यतः एक ही लाइन में लिखा जाता है, उसे Simple Statement कहते हैं।
EnglishA statement that performs a single task and is usually written in one line is called a Simple Statement.
Exampleजो Statement एक Header (:) तथा उसके नीचे Indented Code Block रखता है, उसे Compound Statement कहते हैं।
EnglishA statement that contains a header ending with a colon (:) followed by an indented code block is called a Compound Statement.
ExampleOutput-
Positive
Types of Compound Statements (कम्पाउंड स्टेटमेंट के प्रकार) :-1. Selection Statements
2. Iteration Statements
3. Jump Statements
4. Exception Handling Statements
1. Selection Statements (चयन स्टेटमेंट) -Condition के आधार पर निर्णय लेने वाले Statements को Selection Statements कहते हैं।
EnglishStatements that make decisions based on a condition are called Selection Statements.
Includes (शामिल हैं)जो Statements किसी Code को बार-बार Execute करते हैं उन्हें Iteration Statements कहते हैं।
EnglishStatements that execute a block of code repeatedly are called Iteration Statements.
IncludesExample -
जो Statements Program के Flow को बदलते हैं उन्हें Jump Statements कहते हैं।
EnglishStatements that change the normal flow of program execution are called Jump Statements.
IncludesProgram में आने वाली Errors को संभालने वाले Statements को Exception Handling Statements कहते हैं।
EnglishStatements used to handle runtime errors are called Exception Handling Statements.
IncludesExample -