Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. n = int(input("how many?"))
  2. if (n>0):
  3. counter=0
  4. total=0
  5. l_v=0
  6.  
  7. while counter<n:
  8. x = int(input("enter next number"))
  9. total=total+x
  10. counter=counter+1
  11. if x>l_v:
  12. l_v=x
  13.  
  14.  
  15. print ("the largest value is {0}".format(l_v))
  16. print("the average is ", total/n)
  17. else:
  18. print("What? it is not possible to find the average, sorry ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement