-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
73 lines (60 loc) · 2.93 KB
/
main.py
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
from colorama import Fore
import os
def calculator():
print(Fore.RED + """██████╗ █████╗ ██╗ ██████╗██╗ ██╗██╗ █████╗ ████████╗ ██████╗ ██████╗
██╔════╝██╔══██╗██║ ██╔════╝██║ ██║██║ ██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗
██║ ███████║██║ ██║ ██║ ██║██║ ███████║ ██║ ██║ ██║██████╔╝
██║ ██╔══██║██║ ██║ ██║ ██║██║ ██╔══██║ ██║ ██║ ██║██╔══██╗
╚██████╗██║ ██║███████╗╚██████╗╚██████╔╝███████╗██║ ██║ ██║ ╚██████╔╝██║ ██║
╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝""")
print(Fore.YELLOW)
global choice
choice = int(input("Addition [1] | Soustraction [2] | Multiplication [3] | Division [4] : "))
def addition():
numone = int(input(Fore.MAGENTA + "Entrez un premier nombre : "))
numtwo = int(input(Fore.BLUE + "Entrez un second nombre : "))
result = numone + numtwo
print(Fore.CYAN + "Le résultat est : ", str(result))
input()
os.system("cls")
main()
def soustraction():
numone = int(input(Fore.MAGENTA + "Entrez un premier nombre : "))
numtwo = int(input(Fore.BLUE + "Entrez un second nombre : "))
result = numone - numtwo
print(Fore.CYAN + "Le résultat est : ", str(result))
input()
os.system("cls")
main()
def multiplication():
numone = int(input(Fore.MAGENTA + "Entrez un premier nombre : "))
numtwo = int(input(Fore.BLUE + "Entrez un second nombre : "))
result = numone * numtwo
print(Fore.CYAN + "Le résultat est : ", str(result))
input()
os.system("cls")
main()
def division():
numone = int(input(Fore.MAGENTA + "Entrez un premier nombre : "))
numtwo = int(input(Fore.BLUE + "Entrez un second nombre : "))
result = numone / numtwo
print(Fore.CYAN + "Le résultat est : ", str(result))
input()
os.system("cls")
main()
def main():
calculator()
if choice == 1:
addition()
elif choice == 2:
soustraction()
elif choice == 3:
multiplication()
elif choice == 4:
division()
else:
print(Fore.RED + "Error")
input()
main()
if __name__ == "__main__":
main()