-
Notifications
You must be signed in to change notification settings - Fork 0
/
math_calc.py
43 lines (37 loc) · 1.08 KB
/
math_calc.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
# -*- coding:utf-8 *-
import math
import os
import sys
from math import acos, asin, atan, cos, pi, sin, sqrt, tan
def launch():
os.system("cls")
print('Enter calculation ("help" and "quit" available): ')
main()
def main():
calcul = ""
while calcul != "quit":
calcul = input(">>> ")
if calcul == "help":
os.system("cls")
print("addition = +")
print("subtraction = -")
print("multiplication = *")
print("division = /")
print("truncated division = //")
print("remainder of the division = %")
print("// + % = divmod()")
print("square root = sqrt()")
print("power = **")
print("cosine = cos()")
print("sine = sin()")
print("tangent = tan()")
print("cos-1 = acos()")
print("sin-1 = asin()")
print("tan-1 = atan()")
print("pi = 3.1415......")
main()
else:
print(eval(calcul))
print()
def api(calc):
return eval(calc)