def remove_comments(s):
    """
    Examples
    --------
    >>> code = '''
    ... # comment 1
    ...  # comment 2
    ... echo foo
    ... '''
    >>> remove_comments(code)
    'echo foo'
    """
    return "\n".join(l for l in s.strip().split("\n") if not l.strip().startswith("#"))