In [4]:

count(sub[, start[, end]])

2025-05-29 13:18

Returns the number of occurrences of a substring.

### count(sub[, start[, end]])

**Description:**
Returns the number of non-overlapping occurrences of substring sub in the string.

**Example:**
“`python
text = “banana”
print(text.count(“a”)) # Output: 3
“`

**Use Case:**
Used to analyze the frequency of characters or substrings in text data.