Balanced Brackets Using Stack In Python