def comment(self=str('')):
    """Generate a single-line QASM 2.0 comment from a string.

    Args:
        self(str): String to add as a comment in QASM 2.0 (default str(''))
    Returns:
        str: Generated QASM 2.0 comment."""
    # Generate QASM 2.0 comment from self parameter.
    qasm_comment = f'// {str(self)}'
    # Return generated QASM 2.0.
    return qasm_comment