Unit 3 2
Unit 3 2
1️⃣ count()
text = "banana"
print(text.count("a")) # Output: 3
2️⃣ endswith()
text = "hello.py"
3️⃣ startswith()
text = "hello.py"
4️⃣ replace()
5️⃣ strip()
6️⃣ split()
text = "a,b,c"
7️⃣ lower()
text = "HELLO"
8️⃣ upper()
text = "hello"
import re
2️) search()
import re
3️) split()
import re
text = "apple1banana2mango"
4️) sub()
import re
import pandas as pd
s = pd.Series(['Hello', 'World'])