Skip to content

Commit f5639e2

Browse files
Day 10: String Methods in Python
1 parent 0c30c0b commit f5639e2

File tree

4 files changed

+150
-2
lines changed

4 files changed

+150
-2
lines changed
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Python Programming - Day 10: String Methods in Python
2+
3+
## **String Methods in Python**
4+
5+
### **Introduction**
6+
স্বাগতম **100 Days of Python** সিরিজের ১০ম দিনে! আজকের ভিডিওতে আমরা শিখবো Python-এ **String Methods** সম্পর্কে। String Methods ব্যবহার করে আমরা Strings কে সহজেই ম্যানিপুলেট করতে পারি। যেমন: uppercase বা lowercase করা, whitespace remove করা, বা কোনো সাবস্ট্রিং খুঁজে বের করা।
7+
8+
---
9+
10+
## **String Methods in Python**
11+
12+
Python-এ Strings নিয়ে কাজ করার জন্য অনেক built-in মেথড রয়েছে। আজ আমরা কিছু গুরুত্বপূর্ণ মেথড শিখবো:
13+
14+
| মেথড | বর্ণনা | উদাহরণ |
15+
|-------|--------|--------|
16+
| `len()` | স্ট্রিংয়ের দৈর্ঘ্য (length) রিটার্ন করে | `len("Python")``6` |
17+
| `upper()` | স্ট্রিংকে uppercase এ কনভার্ট করে | `"hello".upper()``"HELLO"` |
18+
| `lower()` | স্ট্রিংকে lowercase এ কনভার্ট করে | `"HELLO".lower()``"hello"` |
19+
| `strip()` | স্ট্রিংয়ের শুরু ও শেষের whitespace মুছে দেয় | `" Python ".strip()``"Python"` |
20+
| `replace()` | স্ট্রিংয়ের কোনো অংশ অন্য টেক্সট দিয়ে প্রতিস্থাপন করে | `"I love Java".replace("Java", "Python")``"I love Python"` |
21+
| `split()` | স্ট্রিংকে নির্দিষ্ট separator দিয়ে ভেঙে লিস্টে কনভার্ট করে | `"Python,Java,C++".split(",")``['Python', 'Java', 'C++']` |
22+
| `startswith()` | স্ট্রিংটি নির্দিষ্ট টেক্সট দিয়ে শুরু হয়েছে কিনা চেক করে | `"https://codewithtanim.com".startswith("https")``True` |
23+
| `endswith()` | স্ট্রিংটি নির্দিষ্ট টেক্সট দিয়ে শেষ হয়েছে কিনা চেক করে | `"file.txt".endswith(".txt")``True` |
24+
| `find()` | সাবস্ট্রিংয়ের ইনডেক্স রিটার্ন করে (খুঁজে না পেলে -1 রিটার্ন করে) | `"Hello World".find("World")``6` |
25+
| `count()` | সাবস্ট্রিং কতবার স্ট্রিংয়ে আছে তা রিটার্ন করে | `"Python is awesome, Python is easy".count("Python")``2` |
26+
27+
---
28+
29+
## **উদাহরণ সহ ব্যাখ্যা**
30+
31+
### **1. len()**
32+
```python
33+
text = "Code With Tanim"
34+
print(len(text)) # আউটপুট: 14
35+
```
36+
37+
### **2. upper() ও lower()**
38+
```python
39+
text = "Hello Python"
40+
print(text.upper()) # আউটপুট: "HELLO PYTHON"
41+
print(text.lower()) # আউটপুট: "hello python"
42+
```
43+
44+
### **3. strip()**
45+
```python
46+
text = " Python is fun! "
47+
print(text.strip()) # আউটপুট: "Python is fun!"
48+
```
49+
50+
### **4. replace()**
51+
```python
52+
text = "I love Java"
53+
new_text = text.replace("Java", "Python")
54+
print(new_text) # আউটপুট: "I love Python"
55+
```
56+
57+
### **5. split()**
58+
```python
59+
text = "Python,Java,C++"
60+
print(text.split(",")) # আউটপুট: ['Python', 'Java', 'C++']
61+
```
62+
63+
### **6. startswith() ও endswith()**
64+
```python
65+
url = "https://www.github.com"
66+
print(url.startswith("https")) # আউটপুট: True
67+
print(url.endswith(".bd")) # আউটপুট: False
68+
```
69+
70+
### **7. find()**
71+
```python
72+
text = "Hello World"
73+
print(text.find("World")) # আউটপুট: 6
74+
```
75+
76+
### **8. count()**
77+
```python
78+
text = "Python is awesome, Python is easy"
79+
print(text.count("Python")) # আউটপুট: 2
80+
```
81+
82+
---
83+
84+
## **Today's Challenge! 🎯**
85+
✅ নিচের কোডটি রান করুন এবং আউটপুট পর্যবেক্ষণ করুন:
86+
```python
87+
text = " Python Programming is Fun! "
88+
# Challenge:
89+
# 1. Remove extra whitespace
90+
# 2. Convert to uppercase
91+
# 3. Replace "Fun" with "Awesome"
92+
# 4. Count how many times "Python" appears in the string
93+
```
94+
95+
📢 **কমেন্টে জানান, আপনি সফলভাবে কোড রান করতে পেরেছেন কিনা!** 💬
96+
97+
---
98+
99+
## **Next Topic: If Else Coditional Statements in Python**
100+
🔔 **তাই, ভিডিওটি লাইক করুন, কমেন্ট করুন, এবং চ্যানেলটি সাবস্ক্রাইব করুন!** 🚀
101+
102+
👉 **CodeWithTanim - 100 Days of Python 🚀**
103+
104+
---
105+
106+
**[Note:]**
107+
- Strings immutable (অপরিবর্তনীয়)। তাই কোনো মেথড সরাসরি মূল স্ট্রিংকে পরিবর্তন করে না, বরং নতুন স্ট্রিং রিটার্ন করে।
108+
- Strings নিয়ে আরও গভীরভাবে আলোচনা করা হবে পরবর্তী ভিডিওতে।
109+
110+
---
111+
112+
**Happy Coding! 😊**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
text = "Code With Tanim"
2+
3+
print(len(text))
4+
5+
text2 = "hello world"
6+
7+
print(text2.upper())
8+
print(text2.lower())
9+
10+
text3 = " Python is fun! "
11+
12+
print(text3.strip())
13+
14+
15+
text4 = "I Love Java"
16+
17+
nex_text4 = text4.replace("Java", "Python")
18+
19+
print(nex_text4)
20+
21+
text5 = "Python, Java, C++"
22+
print(text5.split(","))
23+
24+
url = "https://www.github.com"
25+
print(url.startswith("https"))
26+
print(url.endswith("https"))
27+
28+
text6 = "Hello World"
29+
30+
print(text6.find("World"))
31+
print(text6.find("Tanim"))
32+
33+
text7 = "Python is awesome, Python is easy"
34+
35+
print(text7.count("Python"))

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ Are you ready to **master Python** in just **100 days**? This challenge is desig
2929
| 7 | User Input in Python | [Watch Now](https://youtu.be/PDC2Am-o6As) | [View Notes](https://github.com/CodeWithTanim/100-Days-of-Python/blob/main/Day%207%3A%20User%20Input%20in%20Python/Day%207%20Class%20Notes.md) |
3030
| 8 | Strings in Python | [Watch Now](https://youtu.be/SnGR1z2CHYM) | [View Notes](https://github.com/CodeWithTanim/100-Days-of-Python/blob/main/Day%208%3A%20Strings%20in%20Python/Day%208%20Class%20Note.md) |
3131
| 9 | Strings Slicing and Operations on Strings in Python | [Watch Now](https://youtu.be/ITHzi5GOrRk) | [View Notes](https://github.com/CodeWithTanim/100-Days-of-Python/blob/main/Day%209%3A%20Strings%20Slicing%20and%20Operations%20on%20Strings%20in%20Python/Day%209%20Class%20Note.md) |
32+
| 10 | String Methods in Python | [Watch Now](| 1 | | [Watch Now]() | [View Notes]() |) | [View Notes]() |
3233
| ... | Coming Soon... | 🔜 | 🔜 |
3334
<!-- | 1 | | [Watch Now]() | [View Notes]() |
3435
3536
3637
3738
38-
| 1 | | [Watch Now]() | [View Notes]() |
39+
3940
| 1 | | [Watch Now]() | [View Notes]() |
4041
| 1 | | [Watch Now]() | [View Notes]() |
4142
| 1 | | [Watch Now]() | [View Notes]() |

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ <h1>📚 100 Days of Python - Video & Notes 🎥</h1>
180180
{ day: 7, topic: "User Input in Python", video: "https://youtu.be/PDC2Am-o6As", notes: "https://github.com/CodeWithTanim/100-Days-of-Python/blob/main/Day%207%3A%20User%20Input%20in%20Python/Day%207%20Class%20Notes.md" },
181181
{ day: 8, topic: "Strings in Python", video: "https://youtu.be/SnGR1z2CHYM", notes: "https://github.com/CodeWithTanim/100-Days-of-Python/blob/main/Day%208%3A%20Strings%20in%20Python/Day%208%20Class%20Note.md" },
182182
{ day: 9, topic: "Strings Slicing and Operations on Strings in Python", video: "https://youtu.be/ITHzi5GOrRk", notes: "https://github.com/CodeWithTanim/100-Days-of-Python/blob/main/Day%209%3A%20Strings%20Slicing%20and%20Operations%20on%20Strings%20in%20Python/Day%209%20Class%20Note.md" },
183-
// { day: 10, topic: "", video: "", notes: "" },
183+
{ day: 10, topic: "String Methods in Python", video: "https://youtu.be/USDzDeqxOGk", notes: "" },
184184
// { day: 11, topic: "", video: "", notes: "" },
185185
// { day: 12, topic: "", video: "", notes: "" },
186186
// { day: 13, topic: "", video: "", notes: "" },

0 commit comments

Comments
 (0)