Q. Write a program to find the sum of digits of an integer number, input by the user.
Answer :-
num = input("Enter a number :-") sum = 0 for i in num : sum += int (i) print("Sum of digit :- ", sum)
Output :-
Enter a number :-123
Sum of digit :- 6
>>>
Thank you bro
ReplyDeleteWelcome : )
DeleteYou da best
ReplyDeleteThank you so much. : )
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )