Python | Conditional Check
see the Successfully Accepted Submission\n\n# Code\n\nclass Solution:\n    def countSeniors(self, details: List[str]) -> int:\n        senior_count = 0\n       
[see the Successfully Accepted Submission](https://leetcode.com/problems/number-of-senior-citizens/submissions/1340425027/?envType=daily-question&envId=2024-08-01)\n\n# Code\n```\nclass Solution:\n    def countSeniors(self, details: List[str]) -> int:\n        senior_count = 0\n        for detail in details:\n            age = int(detail[11:13])\n            if age > 60:\n                senior_count += 1\n        return senior_count\n        \n```\n\n# Solution Explanation\n\n## Steps:\n1. Initialize a counter to keep track of the number of passengers older than 60.\n2. Iterate through each string in the details list.\n3. Extract the age from the string using slicing. The age is represented by the substring at indices 11 and 12.\n4. Convert the extracted substring to an integer.\n5. Check if the age is greater than 60. If it is, increment the counter.\n\n## Explanation with Examples:\nLet\'s break down how this function works with the provided examples.\n\n### Example 1:\n- **Input:** `details = ["7868190130M7522","5303914400F9211","9273338290F4010"]`\n- **Processing:**\n  - For the first string "7868190130M7522", the age substring is "75", which converts to 75 (greater than 60).\n  - For the second string "5303914400F9211", the age substring is "92", which converts to 92 (greater than 60).\n  - For the third string "9273338290F4010", the age substring is "40", which converts to 40 (not greater than 60).\n- **Output:** 2 (since there are two passengers older than 60).\n\n### Example 2:\n- **Input:** `details = ["1313579440F2036","2921522980M5644"]`\n- **Processing:**\n  - For the first string "1313579440F2036", the age substring is "20", which converts to 20 (not greater than 60).\n  - For the second string "2921522980M5644", the age substring is "56", which converts to 56 (not greater than 60).\n- **Output:** 0 (since there are no passengers older than 60).\n\n\n\n![image](https://assets.leetcode.com/users/images/b1e4af48-4da1-486c-bc97-b11ae02febd0_1696186577.992237.jpeg)
['Python3']