def append_code(html, code, *args):
    """
    Appends the given code to the existing HTML code
    """
    if args:
        # Format added code first
        code = code.format(*args)

    return "{0}\n{1}".format(html, code)