marina-maths 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: marina-maths
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Package de calcul mathematique avec menu interactif
|
|
5
|
+
Author: Marina
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Dynamic: author
|
|
8
|
+
Dynamic: description
|
|
9
|
+
Dynamic: description-content-type
|
|
10
|
+
Dynamic: summary
|
|
11
|
+
|
|
12
|
+
# Marina Maths Calculator
|
|
13
|
+
|
|
14
|
+
## Auteur
|
|
15
|
+
|
|
16
|
+
Marina
|
|
17
|
+
|
|
18
|
+
## Version
|
|
19
|
+
|
|
20
|
+
1.0.0
|
|
21
|
+
|
|
22
|
+
## Description
|
|
23
|
+
|
|
24
|
+
Marina Maths Calculator est un package Python permettant
|
|
25
|
+
d'effectuer des calculs mathématiques à partir d'un menu
|
|
26
|
+
interactif personnalisé.
|
|
27
|
+
|
|
28
|
+
## Fonctionnalités
|
|
29
|
+
|
|
30
|
+
- Saisie du nom de l'utilisateur
|
|
31
|
+
- Addition
|
|
32
|
+
- Soustraction
|
|
33
|
+
- Multiplication
|
|
34
|
+
- Division
|
|
35
|
+
- Puissance
|
|
36
|
+
- Racine carrée
|
|
37
|
+
- Moyenne
|
|
38
|
+
- Minimum
|
|
39
|
+
- Maximum
|
|
40
|
+
- Gestion des erreurs
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install --index-url https://test.pypi.org/simple/ --no-deps marina-maths
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Utilisation
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from mon_package import menu
|
|
52
|
+
|
|
53
|
+
menu()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Remerciements
|
|
57
|
+
|
|
58
|
+
Merci d'utiliser Marina Maths Calculator.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
mon_package/__init__.py,sha256=PRsN00gDaFq8oea1mBWFsWWOKUU6YmK05aMv0Br4sII,22
|
|
2
|
+
mon_package/math_utils.py,sha256=Kg-iXhaZuSJHVY7gIEHwo84jeIJcrySOFFUM4vu1GGA,475
|
|
3
|
+
mon_package/menu.py,sha256=Uvbwr4CGNaha89rqo3eVZHJKgmkKoDl7nDz8YdwtsiQ,2871
|
|
4
|
+
marina_maths-1.0.0.dist-info/METADATA,sha256=XGULsRgD5xDDQtlE2mHG_jGZ9KKlAiUBz5ecmRRkymI,910
|
|
5
|
+
marina_maths-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
6
|
+
marina_maths-1.0.0.dist-info/top_level.txt,sha256=0L0XBQBT_heXC3cutSTQ1IbyM4SQnEWLBv-gJY2N5R8,12
|
|
7
|
+
marina_maths-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mon_package
|
mon_package/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .menu import menu
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import math
|
|
2
|
+
|
|
3
|
+
def addition(a, b):
|
|
4
|
+
return a + b
|
|
5
|
+
|
|
6
|
+
def soustraction(a, b):
|
|
7
|
+
return a - b
|
|
8
|
+
|
|
9
|
+
def multiplication(a, b):
|
|
10
|
+
return a * b
|
|
11
|
+
|
|
12
|
+
def division(a, b):
|
|
13
|
+
if b == 0:
|
|
14
|
+
raise ValueError("Division par zéro impossible")
|
|
15
|
+
return a / b
|
|
16
|
+
|
|
17
|
+
def puissance(a, b):
|
|
18
|
+
return a ** b
|
|
19
|
+
|
|
20
|
+
def racine_carree(a):
|
|
21
|
+
return math.sqrt(a)
|
|
22
|
+
|
|
23
|
+
def moyenne(liste):
|
|
24
|
+
return sum(liste) / len(liste)
|
|
25
|
+
|
|
26
|
+
def minimum(liste):
|
|
27
|
+
return min(liste)
|
|
28
|
+
|
|
29
|
+
def maximum(liste):
|
|
30
|
+
return max(liste)
|
mon_package/menu.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from . import math_utils
|
|
2
|
+
|
|
3
|
+
def menu():
|
|
4
|
+
|
|
5
|
+
print("==MARINA MATHS CALCULATOR==")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
nom = input("Entrez votre nom : ")
|
|
9
|
+
|
|
10
|
+
print("\nBienvenue", nom, "dans notre calculatrice !")
|
|
11
|
+
|
|
12
|
+
while True:
|
|
13
|
+
|
|
14
|
+
print("Faites un choix")
|
|
15
|
+
print("1. Addition")
|
|
16
|
+
print("2. Soustraction")
|
|
17
|
+
print("3. Multiplication")
|
|
18
|
+
print("4. Division")
|
|
19
|
+
print("5. Puissance")
|
|
20
|
+
print("6. Racine carrée")
|
|
21
|
+
print("7. Moyenne")
|
|
22
|
+
print("8. Minimum")
|
|
23
|
+
print("9. Maximum")
|
|
24
|
+
print("0. Quitter")
|
|
25
|
+
|
|
26
|
+
choix = input(nom + ", entrez votre choix : ")
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
|
|
30
|
+
if choix == "1":
|
|
31
|
+
|
|
32
|
+
a = float(input("Premier nombre : "))
|
|
33
|
+
b = float(input("Deuxième nombre : "))
|
|
34
|
+
|
|
35
|
+
resultat = math_utils.addition(a, b)
|
|
36
|
+
|
|
37
|
+
elif choix == "2":
|
|
38
|
+
|
|
39
|
+
a = float(input("Premier nombre : "))
|
|
40
|
+
b = float(input("Deuxième nombre : "))
|
|
41
|
+
|
|
42
|
+
resultat = math_utils.soustraction(a, b)
|
|
43
|
+
|
|
44
|
+
elif choix == "3":
|
|
45
|
+
|
|
46
|
+
a = float(input("Premier nombre : "))
|
|
47
|
+
b = float(input("Deuxième nombre : "))
|
|
48
|
+
|
|
49
|
+
resultat = math_utils.multiplication(a, b)
|
|
50
|
+
|
|
51
|
+
elif choix == "4":
|
|
52
|
+
|
|
53
|
+
a = float(input("Premier nombre : "))
|
|
54
|
+
b = float(input("Deuxième nombre : "))
|
|
55
|
+
|
|
56
|
+
resultat = math_utils.division(a, b)
|
|
57
|
+
|
|
58
|
+
elif choix == "5":
|
|
59
|
+
|
|
60
|
+
a = float(input("Entrez la base : "))
|
|
61
|
+
b = float(input("Entrez l'exposant : "))
|
|
62
|
+
|
|
63
|
+
resultat = math_utils.puissance(a, b)
|
|
64
|
+
|
|
65
|
+
elif choix == "6":
|
|
66
|
+
|
|
67
|
+
a = float(input("Entrez un nombre : "))
|
|
68
|
+
|
|
69
|
+
resultat = math_utils.racine_carree(a)
|
|
70
|
+
|
|
71
|
+
elif choix == "7":
|
|
72
|
+
|
|
73
|
+
valeurs = input("Entrez les nombres séparés par des espaces : ")
|
|
74
|
+
liste = [float(x) for x in valeurs.split()]
|
|
75
|
+
|
|
76
|
+
resultat = math_utils.moyenne(liste)
|
|
77
|
+
|
|
78
|
+
elif choix == "8":
|
|
79
|
+
|
|
80
|
+
valeurs = input("Entrez les nombres séparés par des espaces : ")
|
|
81
|
+
liste = [float(x) for x in valeurs.split()]
|
|
82
|
+
|
|
83
|
+
resultat = math_utils.minimum(liste)
|
|
84
|
+
|
|
85
|
+
elif choix == "9":
|
|
86
|
+
|
|
87
|
+
valeurs = input("Entrez les nombres séparés par des espaces : ")
|
|
88
|
+
liste = [float(x) for x in valeurs.split()]
|
|
89
|
+
|
|
90
|
+
resultat = math_utils.maximum(liste)
|
|
91
|
+
|
|
92
|
+
elif choix == "0":
|
|
93
|
+
|
|
94
|
+
print("Merci", nom, "pour votre visite !")
|
|
95
|
+
print("À bientôt !")
|
|
96
|
+
break
|
|
97
|
+
|
|
98
|
+
else:
|
|
99
|
+
|
|
100
|
+
print("Choix invalide. Réessayez.")
|
|
101
|
+
continue
|
|
102
|
+
|
|
103
|
+
print(nom + ", votre résultat est :", resultat)
|
|
104
|
+
|
|
105
|
+
except (ValueError, ArithmeticError):
|
|
106
|
+
|
|
107
|
+
print("Erreur : veuillez entrer des valeurs valides.")
|