Statements in Python पायथन में कथन

In Python, statements are individual instructions that the interpreter can execute. Here are some common types of statements:
पायथन में, कथन व्यक्तिगत निर्देश होते हैं जिन्हें दुभाषिया निष्पादित कर सकता है। यहां कुछ सामान्य प्रकार के कथन दिए गए हैं:

1. Assignment Statement असाइनमेंट स्टेटमेंट:-

x = 10

2. Conditional Statement (if-else) सशर्त विवरण (यदि अन्यथा):-

if x > 5:
 print("x is greater than 5")
else:
 print("x is not greater than 5")

3. Looping Statements (for and while) लूपिंग स्टेटमेंट (फॉर और व्हाईल):-

for i in range(5):
 print(i)

x=5
while x > 0:
 print(x)
 x -= 1

4. Function Definition फंक्शन परिभाषा:-

def greet(name):
 print("Hello, " + name + "!")

5. Import Statement इम्पोर्ट कथन:-

import math

These are just a few examples, and there are many other types of statements in Python. Each statement serves a specific purpose and contributes to the overall functionality of a program.
ये केवल कुछ उदाहरण हैं, और Python में कई अन्य प्रकार के कथन भी हैं। प्रत्येक कथन एक विशिष्ट उद्देश्य को पूरा करता है और प्रोग्राम की समग्र कार्यक्षमता में योगदान देता है।

No comments:

Post a Comment

mcq test

  🧠 Q71. If 1st January 2020 was Wednesday, then what day of the week was 1st January 2021? Choose the correct answer: --Selec...