Problem 16 Added

Solution to the Problem 16  has been added.
This commit is contained in:
Thejus-Paul
2017-11-20 01:34:21 +05:30
parent 0f78cd6a55
commit c787a22d93
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,15 @@
power = int(input("Enter the power of 2: "))
num = 2**power
string_num = str(num)
list_num = list(string_num)
sum_of_num = 0
print("2 ^",power,"=",num)
for i in list_num:
sum_of_num += int(i)
print("Sum of the digits are:",sum_of_num)