endswith
count
format
Returns the number of non-overlapping occurrences of a substring.
str.count(sub, start?, end?)
Enter values below to update the example in real time.
print
text = "banana" print(text.count("a")) # 3 print(text.count("an")) # 2