Doubt in Basic Calculator Q

My outputs of this code are coming correct. But it is failing testcases 3 to 6. Why?

Varun pls share your code by saving on ide so that I could check your code…

Anybody please solve it!