Can you help me in finding the bug : Buggy Calculator

CodeChef: Practical coding for everyone I followed a different approach than others.

There should be not leading zeros in the result. Your solution would fail for:

1 
555 500

either convert the result to int

print(int(tmep))

or

remove the leading 0s.

2 Likes

remove leading zeros ‘0’ or if all value is zero the print only one zero ‘0’ if got the same problem

2

54 54

55 55

output

8

0

my code link CodeChef: Practical coding for everyone

Thank you :slight_smile: