Computer Science, asked by sham6704, 8 months ago

Write python program to input a number and print sum, frequency and average of digits of the number

Answers

Answered by harika555
0

Answer:

Explanation:

n=int(input("enter number"))  

sum=0  

count=0

d={}

while n>0:

   r=n%10  

   if r in d:                                  

       d[r]+=1

   else:

       d[r]=1

   n=n//10

   sum+=r

   count+=1

print(sum)

avg=sum//count

print(avg)

print(d)

Similar questions