Note: In the above Python code , '[' has been replaced by [ (I don't know the reason), Please replace that before using that code.