Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l=[]
- n=int(input("Donner le longueur de la liste:"))
- for i in range(n):
- x=int(input("Donner les elements de tableau:"))
- l.append(x)
- moyenne=0
- for i in range(len(l)):
- moyenne=l[i]+moyenne
- moyenne=moyenne/n
- def high(l):
- maxi=l[0]
- for i in range(len(l)):
- if l[i]>=maxi:
- maxi=l[i]
- return maxi
- def low(l):
- mini=l[0]
- for i in range(len(l)):
- if l[i]<=mini:
- mini=l[i]
- return mini
- print("le moyenne de la liste est:",moyenne)
- print("le max de la la liste est:",high(l))
- print("le min de la liste est:", low(l))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement