#write a program that reads one positive 4-digit number #and prints the sum of the digits #additional task: at the end of the program we also want to print an original #input. To implement this we will use an additional variable and save #original value before calculations. #Discussion: #Input:integer, between 1000 and 9999 stored in variable num #Output: sum of digits, stored in variable sum #Calculations: int division by 10 and modulo 10 to separate digits and then #add digits together #Input Limitations: integer, between 1000 and 9999 #Part 1 Input: num=int(input("enter integer between 1000 and 9999: ")) #Part 2 Calculation: #Let's call digits d1, d2, d3, d4 where d1 is first digit and d4 is last digit save_num = num #saving an original value d4 = num%10 num = num//10 d3 = num%10 num = num//10 d2= num%10 num = num//10 d1= num%10 sum = d1+d2+d3+d4 #Part 3 Output print("sum of digits of", save_num , "is", sum)