Python vs Java Verdict

Hi everyone.
I submitted a solution in Python where the upper limit of the input may go up to 10^18, and got the verdict as WA. I submitted the same logic(~ read complexity) in Java( with optimized input/output using buffered reader/writers), and it got accepted. So now, this python verdict is misleading the direction of thinking( I wondered how the logic might go wrong, where I was 100% sure it was correct, and was working with every sporadic testcase I tried ). I heard from my friends that they faced similar issues. So any experiences of how you dealt with this in Python, would be of great help.
(P.S.: I saw similar topic raised but that didn’t help ( link: python vs Java ?? ), and didn’t find others apart from this. So please let me know if this is redundant )
Thanks in advance! :slight_smile: