-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
18 lines (18 loc) · 935 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from calculate import calculate as c
from mathKnowledge import mathKnowledge as mK
action = ""
while action.upper() != "END":
action = input(f"Choose an action:\n\n - Calculate (1)\n\n - Learn (2)\n\n - END (0)\n\n")
if action.upper() == "CALCULATE" or action.upper() == "1":
print("Make sure to use ' ' to separate operators, brackets, and numbers. Use * for multiplication, / for division, ^ for powers, sqrt for square root and pi for Pi")
problem = input("Enter math problem: \n")
print(f"{problem} = {str(c.solve(problem))}")
elif action.upper() == "LEARN" or action.upper() == "2":
print("What would you like to learn?")
action = input(f"Here is a list of actions:\n\n - Perfect Square (1)\n\n - Fibonacci Sequence (2)\n\n")
print(f"\n{mK.knowledge(action)}")
elif action.upper() == "END" or action.upper() == "0":
print("Ending project")
break
else:
print("Action does not exist")