ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1493. One Step from Happiness

I think my code is right but it is not getting accepted.
Posted by Tanay 23 Nov 2017 13:44
I think my code is right but it is not getting accepted. Can anyone help me figure out what is wrong ?

The python code is as follows:

n=input()
sum1=0
sum2=0
for i in range(0,3):
    sum1=sum1+(int(n[i]))
for i in range(3,6):
    sum2=sum2+(int(n[i]))
if(1==(abs(sum1-sum2)) or 0==sum1-sum2):
    print("Yes")
else:
    print("No")


Pls help me solve the issue

Edited by author 23.11.2017 13:45