Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input("how many?"))
- if (n>0):
- counter=0
- total=0
- l_v=0
- while counter<n:
- x = int(input("enter next number"))
- total=total+x
- counter=counter+1
- if x>l_v:
- l_v=x
- print ("the largest value is {0}".format(l_v))
- print("the average is ", total/n)
- else:
- print("What? it is not possible to find the average, sorry ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement