Write a python program to count number of digits in a given username. Show the first and last digits of the number, and summation of all the digits.
n = input()
count = 0
sum = 0
for i in range(0,len(n)):
if n[i].isdigit():
sum = sum + int(n[i])
count += 1
print('count = ',count)
print('sum = ',sum)
Comments
Leave a comment