#4f:Codding in Python:{AVERAGE AND SUM FINDER}

#AverageAndSumFinder
print("Press 1 to find sum and press 2 to find average.")
z=int(input("Enter choice"))
if z==1:
    lst=[]
    n=int(input("Enter total number values: "))
    for i in range (n):
        x=int(input("Enter the next value: "))
        lst.append(x)
    print("Values are ",lst)
    print("Total sum is ",sum(lst))



if z==2:
    lst=[]
    n=int(input("Enter total number values: "))
    for i in range (n):
        x=int(input("Enter the next value: "))
        lst.append(x)
    s=sum(lst)
    print("Values are ",lst)
    print("Total sum is ",s)
    avg=s/n
    print("Average is ",avg)



Downloadable CODES are here.

CLICK HERE for online Python.

Comments