Seedha content par jao
🤖 Python Hindi Bot
Namaste! Main Python Hindi Bot hoon 🐍
Python ya AI se related kuch bhi type karke pucho, ya neeche se quick sawaal chuno.
WhatsApp

Stay Connected with PythonHindii

Join our WhatsApp Community to get the latest Python tutorials, coding tips, interview questions, project updates, and learning resources directly on your phone.

Join WhatsApp Community
⇧
Python Hindi Logo
Python in Hindi | Programming Education

Python String क्या है? 🔥 | Python Strings in Hindi | Complete Beginner Tutorial



```html

Python String क्या है? Complete Beginner Tutorial 🔥

आज का यह tutorial Python सीखने वाले beginners के लिए बहुत महत्वपूर्ण है। String Python का सबसे frequently use होने वाला data type है। अगर आप Python में काम करना चाहते हैं, तो आपको Strings के बारे में गहरी समझ होनी चाहिए। इस post में हम Python Strings को step-by-step सीखेंगे और practical examples के साथ समझेंगे।

String क्या होता है? (What is String?)

String एक data type है जो text data को represent करता है। Python में string को single quotes (''), double quotes (""), या triple quotes (''' ''' या """ """) में लिखा जा सकता है। String में letters, numbers, symbols, और spaces सब कुछ हो सकता है।

Simple शब्दों में: जो भी आप quotes के अंदर लिखते हैं, वह string बन जाता है।

String को Define करने के तरीके:

  • Single Quotes: 'Hello World'
  • Double Quotes: "Hello World"
  • Triple Quotes: '''Multi-line String'''

Practical Examples के साथ String Concepts

1. String को Variable में Store करना

# String को variable में store करना
name = "Rajesh"
city = 'Delhi'
message = '''यह एक multi-line
string का उदाहरण है'''

print(name)
print(city)
print(message)

Output:

Rajesh
Delhi
यह एक multi-line
string का उदाहरण है

2. String की Length निकालना (len function)

# String की length निकालना
text = "Python Programming"
length = len(text)
print(f"String की length: {length}")

name = "Aman"
print(f"'{name}' में {len(name)} characters हैं")

Output:

String की length: 18
'Aman' में 4 characters हैं

3. String Indexing (किसी character को access करना)

Python में indexing 0 से start होती है। हर character का एक specific index होता है।

# String indexing
text = "PYTHON"
#      012345

print(text[0])    # Output: P
print(text[1])    # Output: Y
print(text[5])    # Output: N

# Negative indexing
print(text[-1])   # Output: N (आखिरी character)
print(text[-2])   # Output: O (दूसरा आखिरी character)

4. String Slicing (String का एक हिस्सा निकालना)

Slicing का syntax है: string[start:end:step]

# String slicing
name = "Programming"

print(name[0:4])      # Output: Prog
print(name[4:11])     # Output: ramming
print(name
🧑‍💻 Python Coding Lab

Python code likho, run karo aur practice karo — directly browser mein.