-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyse.py
More file actions
75 lines (67 loc) · 2.09 KB
/
analyse.py
File metadata and controls
75 lines (67 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def remplirUneListe(Liste):
taille_liste=int(input("donner le nombre des employés :"))
for i in range(0,taille_liste):
print("EMPLOYE NUMERO :",i)
x = int(input("donner son salaire :"))
Liste.append(x)
def calculSommeListe(Liste):
taille=len(Liste)
somme=0
for i in range(0,taille):
xi=Liste[i]
somme=somme+xi
return somme
def calculSalaireMoyen(Liste):
qq=0
taille=len(Liste)
somm = 0
for i in range(0,taille):
somm=somm+Liste[i]
sal_moy=somm/taille
return sal_moy
def calculVariance(Liste):
sal_moy=calculSalaireMoyen(Liste)
taille=len(Liste)
for i in range(0,taille):
p=Liste[i]
q=(p-sal_moy)**2
variances=(q/taille)
return variances
def calculEcartType(Liste):
o=calculVariance(Liste)
op=o**(1/2)
return op
def calculSalaireMedian(Liste):
minimum=min(Liste)
maximum=max(Liste)
salaire_median=(minimum+maximum)/2
return salaire_median
def ListeEmployeeAvecSalaireSuperieureAuSalaireMoyen(Liste):
Liste_Employee_Sup_Moy = []
salaire_moy=calculSalaireMoyen(Liste)
taille=len(Liste)
for i in range(0,taille):
s=Liste[i]
if(s>salaire_moy):
Liste_Employee_Sup_Moy.append(i)
return Liste_Employee_Sup_Moy
##################EXECUTION################
Employee = []
remplirUneListe(Employee)
v=calculVariance(Employee)
e=calculEcartType(Employee)
s=calculSalaireMoyen(Employee)
som=calculSommeListe(Employee)
m=calculSalaireMedian(Employee)
print("---------------------------------------------------------------------")
l=ListeEmployeeAvecSalaireSuperieureAuSalaireMoyen(Employee)
pourcentage=((len(l))/(len(Employee)))*100
print("VOICI NOTRE LISTE :", Employee)
print("SALAIRE MAX :",max(Employee))
print("SALAIRE MIN :", min(Employee))
print("SALAIRE MOYEN: ",s)
print("SALAIRE MEDIAN: ", m)
print("MASSE SALARIALE: ",som)
print("VARIANCE DES SALAIRE: ",v)
print("ECART TYPE DES SALAIRE: ",e)
print("EMPLOYEE AVEC SALAIRE SUP AU SALAIRE MOY :",l," Soit : ",pourcentage,"%")