python3 code
Code\n\nclass Solution:\n    def countPrefixes(self, words: List[str], s: str) -> int:\n        return len([word for word in words if s.startswith(word)])\n\n\n
# Code\n```\nclass Solution:\n    def countPrefixes(self, words: List[str], s: str) -> int:\n        return len([word for word in words if s.startswith(word)])\n```\n\n![image.png](https://assets.leetcode.com/users/images/7ded423d-5651-41aa-8a7e-b8343efb856e_1672271463.1473987.png)\n![image.png](https://assets.leetcode.com/users/images/65605e1b-564a-4ea3-8bf0-acad0d5862ea_1672271490.074425.png)
['Python3']