x=eval(input(" Enter The value: "))
y=x//1000
y1=(x-y*1000)//100
y2=(x-y*1000-y1*100)//10
y3=x-y*1000-y1*100-y2*10
print("Sum of the entered no. is: ",y+y1+y2+y3)
Output
Enter The value: 1234
Sum of the entered no. is: 10
x=eval(input(" Enter The value: "))
y=x//1000
y1=(x-y*1000)//100
y2=(x-y*1000-y1*100)//10
y3=x-y*1000-y1*100-y2*10
print("Sum of the entered no. is: ",y+y1+y2+y3)
Output
Enter The value: 1234
Sum of the entered no. is: 10