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)
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 में कई अन्य प्रकार के कथन भी हैं। प्रत्येक कथन एक विशिष्ट उद्देश्य को पूरा करता है और प्रोग्राम की समग्र कार्यक्षमता में योगदान देता है।
Comments
Post a Comment