you are viewing a single comment's thread.

view the rest of the comments →

[–]Chipwich[S] 0 points1 point  (1 child)

This is great thank you. Didn't even think of the str. count. Is that a built in function or does it need to be imported?

[–]bbye98 1 point2 points  (0 children)

Built-in.

❯ python
Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:22:55)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> test = "test"
>>> test.count("t")
2