Typecasting each character to integer and adding the digit to respective sums
Leftsum = Leftsum + int ( s [ i ] ) NEW_LINE Rightsum = ( Rightsum + int ( s [ len ( s ) - 1 - i ] ) ) NEW_LINE if ( Leftsum == Rightsum ) : NEW_LINE print ( " Balanced " , end =   ' ' ) NEW_LINE else : NEW_LINE print ( " Not ▁ Balanced " , end =   ' ' ) NEW_LINE