Python | Easy
see the Successfully Accepted Submission\n\n# Code\n\nclass Solution:\n    def scoreOfString(self, s: str) -> int:\n        score = 0\n        for i in range(1,
[see the Successfully Accepted Submission](https://leetcode.com/problems/score-of-a-string/submissions/1273862859/?source=submission-ac)\n\n# Code\n```\nclass Solution:\n    def scoreOfString(self, s: str) -> int:\n        score = 0\n        for i in range(1, len(s)):\n            score += abs(ord(s[i]) - ord(s[i - 1]))\n        return score\n\n```\n![image](https://assets.leetcode.com/users/images/b1e4af48-4da1-486c-bc97-b11ae02febd0_1696186577.992237.jpeg)
['Python3']