TGViewer
Python for Data Analysts Python for Data Analysts @pythonanalyst ยท 51.7K subscribers
Post #511 3.12K
๐’๐ญ๐ซ๐ข๐ง๐  ๐Œ๐š๐ง๐ข๐ฉ๐ฎ๐ฅ๐š๐ญ๐ข๐จ๐ง ๐ข๐ง ๐๐ฒ๐ญ๐ก๐จ๐ง:
Strings in Python are immutable sequences of characters.

๐Ÿ- ๐ฅ๐ž๐ง(): ๐‘๐ž๐ญ๐ฎ๐ซ๐ง๐ฌ ๐ญ๐ก๐ž ๐ฅ๐ž๐ง๐ ๐ญ๐ก ๐จ๐Ÿ ๐ญ๐ก๐ž ๐ฌ๐ญ๐ซ๐ข๐ง๐ .

my_string = "Hello"
length = len(my_string)  # length will be 5

๐Ÿ- ๐ฌ๐ญ๐ซ(): ๐‚๐จ๐ง๐ฏ๐ž๐ซ๐ญ๐ฌ ๐ง๐จ๐ง-๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐๐š๐ญ๐š ๐ญ๐ฒ๐ฉ๐ž๐ฌ ๐ข๐ง๐ญ๐จ ๐ฌ๐ญ๐ซ๐ข๐ง๐ ๐ฌ.

num = 123
str_num = str(num)  # str_num will be "123"

๐Ÿ‘- ๐ฅ๐จ๐ฐ๐ž๐ซ() ๐š๐ง๐ ๐ฎ๐ฉ๐ฉ๐ž๐ซ(): ๐‚๐จ๐ง๐ฏ๐ž๐ซ๐ญ ๐š ๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ญ๐จ ๐ฅ๐จ๐ฐ๐ž๐ซ๐œ๐š๐ฌ๐ž ๐จ๐ซ ๐ฎ๐ฉ๐ฉ๐ž๐ซ๐œ๐š๐ฌ๐ž.

my_string = "Hello"
lower_case = my_string.lower()  # lower_case will be "hello"
upper_case = my_string.upper()  # upper_case will be "HELLO"

๐Ÿ’- ๐ฌ๐ญ๐ซ๐ข๐ฉ(): ๐‘๐ž๐ฆ๐จ๐ฏ๐ž๐ฌ ๐ฅ๐ž๐š๐๐ข๐ง๐  ๐š๐ง๐ ๐ญ๐ซ๐š๐ข๐ฅ๐ข๐ง๐  ๐ฐ๐ก๐ข๐ญ๐ž๐ฌ๐ฉ๐š๐œ๐ž ๐Ÿ๐ซ๐จ๐ฆ ๐š ๐ฌ๐ญ๐ซ๐ข๐ง๐ .

my_string = "   Hello   "
stripped_string = my_string.strip()  # stripped_string will be "Hello"

๐Ÿ“- ๐ฌ๐ฉ๐ฅ๐ข๐ญ(): ๐’๐ฉ๐ฅ๐ข๐ญ๐ฌ ๐š ๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ข๐ง๐ญ๐จ ๐š ๐ฅ๐ข๐ฌ๐ญ ๐จ๐Ÿ ๐ฌ๐ฎ๐›๐ฌ๐ญ๐ซ๐ข๐ง๐ ๐ฌ ๐›๐š๐ฌ๐ž๐ ๐จ๐ง ๐š ๐๐ž๐ฅ๐ข๐ฆ๐ข๐ญ๐ž๐ซ.

my_string = "apple,banana,orange"
fruits = my_string.split(",")  # fruits will be ["apple", "banana", "orange"]

๐Ÿ”- ๐ฃ๐จ๐ข๐ง(): ๐‰๐จ๐ข๐ง๐ฌ ๐ญ๐ก๐ž ๐ž๐ฅ๐ž๐ฆ๐ž๐ง๐ญ๐ฌ ๐จ๐Ÿ ๐š ๐ฅ๐ข๐ฌ๐ญ ๐ข๐ง๐ญ๐จ ๐š ๐ฌ๐ข๐ง๐ ๐ฅ๐ž ๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ฎ๐ฌ๐ข๐ง๐  ๐š ๐ฌ๐ฉ๐ž๐œ๐ข๐Ÿ๐ข๐ž๐ ๐ฌ๐ž๐ฉ๐š๐ซ๐š๐ญ๐จ๐ซ.

fruits = ["apple", "banana", "orange"]
my_string = ",".join(fruits)  # my_string will be "apple,banana,orange"

๐Ÿ•- ๐Ÿ๐ข๐ง๐() ๐š๐ง๐ ๐ข๐ง๐๐ž๐ฑ(): ๐’๐ž๐š๐ซ๐œ๐ก ๐Ÿ๐จ๐ซ ๐š ๐ฌ๐ฎ๐›๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ฐ๐ข๐ญ๐ก๐ข๐ง ๐š ๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐š๐ง๐ ๐ซ๐ž๐ญ๐ฎ๐ซ๐ง ๐ข๐ญ๐ฌ ๐ข๐ง๐๐ž๐ฑ.

my_string = "Hello, world!"
index1 = my_string.find("world")  # index1 will be 7
index2 = my_string.index("world")  # index2 will also be 7

๐Ÿ–- ๐ซ๐ž๐ฉ๐ฅ๐š๐œ๐ž(): ๐‘๐ž๐ฉ๐ฅ๐š๐œ๐ž๐ฌ ๐จ๐œ๐œ๐ฎ๐ซ๐ซ๐ž๐ง๐œ๐ž๐ฌ ๐จ๐Ÿ ๐š ๐ฌ๐ฎ๐›๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ฐ๐ข๐ญ๐ก ๐š๐ง๐จ๐ญ๐ก๐ž๐ซ ๐ฌ๐ฎ๐›๐ฌ๐ญ๐ซ๐ข๐ง๐ .

my_string = "Hello, world!"
new_string = my_string.replace("world", "Python")  # new_string will be "Hello, Python!"

๐Ÿ—- ๐ฌ๐ญ๐š๐ซ๐ญ๐ฌ๐ฐ๐ข๐ญ๐ก() ๐š๐ง๐ ๐ž๐ง๐๐ฌ๐ฐ๐ข๐ญ๐ก(): ๐‚๐ก๐ž๐œ๐ค๐ฌ ๐ข๐Ÿ ๐š ๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ฌ๐ญ๐š๐ซ๐ญ๐ฌ ๐จ๐ซ ๐ž๐ง๐๐ฌ ๐ฐ๐ข๐ญ๐ก ๐š ๐ฌ๐ฉ๐ž๐œ๐ข๐Ÿ๐ข๐ž๐ ๐ฌ๐ฎ๐›๐ฌ๐ญ๐ซ๐ข๐ง๐ .

my_string = "Hello, world!"
starts_with_hello = my_string.startswith("Hello")  # True
ends_with_world = my_string.endswith("world")  # False

๐Ÿ๐ŸŽ- ๐œ๐จ๐ฎ๐ง๐ญ(): ๐‚๐จ๐ฎ๐ง๐ญ๐ฌ ๐ญ๐ก๐ž ๐จ๐œ๐œ๐ฎ๐ซ๐ซ๐ž๐ง๐œ๐ž๐ฌ ๐จ๐Ÿ ๐š ๐ฌ๐ฎ๐›๐ฌ๐ญ๐ซ๐ข๐ง๐  ๐ข๐ง ๐š ๐ฌ๐ญ๐ซ๐ข๐ง๐ .

my_string = "apple, banana, orange, banana"
count = my_string.count("banana")  # count will be 2

Python Free Resources
๐Ÿ‘‡๐Ÿ‘‡
https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L

Hope you'll like it

Like this post if you need more resources like this ๐Ÿ‘โค๏ธ
  • ๐Ÿ‘ 4
  • โค 1
More from @pythonanalyst
  1. Oct 2, 2026Skills for data analyst
  2. Sep 24, 2026GigaChat 3.5 Reasoning is a new open-source LLM designed to reason before generating respoโ€ฆ
  3. Sep 23, 2026Understanding Popular ML Algorithms: 1๏ธโƒฃ Linear Regression: Think of it as drawing a straiโ€ฆ
  4. Aug 22, 2026How to Become a Data Analyst from Scratch! ๐Ÿš€ Whether you're starting fresh or upskilling,โ€ฆ
  5. Aug 20, 2026๐Ÿš€ Top Python Careers You Should Know ๐Ÿ Python Developer ๐Ÿค– AI / Machine Learning Engineeโ€ฆ
  6. Aug 13, 2026๐Ÿ“Š Python for Data Science โ€“ Complete Beginner Roadmap ๐Ÿ๐Ÿš€ ๐Ÿ”น What is Data Science? Dataโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’