<qiyuangong>226_Invert_Binary_Tree_1.py
def invertTree( root):
    if root is None:
        return None
    queue = [root]
    while len(queue):
        curr = queue.pop(0)
        curr.left, curr.right = curr.right, curr.left
        if curr.left is not None:
            queue.append(curr.left)
        if curr.right is not None:
            queue.append(curr.right)
    return root
def sample_funcname ( var_0 ) :
    if var_0 is None :
        return None
    var_2 = [ var_0 ]
    while len ( var_2 ) :
        var_6 = var_2.pop ( 0 )
        var_6.left , var_6.right = var_6.right , var_6.left
        if var_6.left is not None :
            var_2.append ( var_6.left )
        if var_6.right is not None :
            var_2.append ( var_6.right )
    return var_0
