Generate a Python code to execute the following logic
Given a string, take all the characters and add them up, then store the result in a variable.
def add_string(string):
    result = 0
    for char in string:
        result += ord(char)
    return result