#NEWLINE# def variance( X , condition = None , **kwargs ) : #NEWLINE# #INDENT# "\n    Variance of a random expression\n\n    Expectation of (X-E(X))**2\n\n    Examples\n    ========\n\n    >>> from sympy.stats import Die, E, Bernoulli, variance\n    >>> from sympy import simplify, Symbol\n\n    >>> X = Die('X', 6)\n    >>> p = Symbol('p')\n    >>> B = Bernoulli('B', p, 1, 0)\n\n    >>> variance(2*X)\n    35/3\n\n    >>> simplify(variance(B))\n    p*(-p + 1)\n    " #NEWLINE# return cmoment ( X , 2 , condition , ** kwargs )