human
I found an interesting problem on https://www.codewars.com/kata/576bb3c4b1abc497ec000065:
Compare two strings by comparing the sum of their values (ASCII character code).

* For comparing treat all letters as UpperCase
* `null/NULL/Nil/None` should be treated as empty strings
* If the string contains other characters than letters, treat the whole string as it would be empty

Your method should return `true`, if the strings are equal and `false` if they are not equal.

## Examples:
```
"AD", "BC"  -> equal
"AD", "DD"  -> not equal
"gf", "FG"  -> equal
"zz1", ""   -> equal (both are considered empty)
"ZzZz", "ffPFF" -> equal
"kl", "lz"  -> not equal
null, ""    -> equal
```

I tried it in Python, but could not do it. Can you solve it?

 Can you provide a Python code to compare two strings by comparing the sum of their values (ASCII character code)?
assistant
#Here is Python code to compare two strings by comparing the sum of their values (ASCII character code).

from typing import Union

def compare(s1: Union[str, None], s2: Union[str, None]) -> bool:
    def value(s: Union[str, None]):
        return sum(map(ord, s.upper())) if s and all(c.isalpha() for c in s) else 0

    return value(s1) == value(s2)