-
Notifications
You must be signed in to change notification settings - Fork 4
/
Math_Slover.py
47 lines (22 loc) · 908 Bytes
/
Math_Slover.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
import Config
import random
import wolframalpha
import Speak
Respond: list = ["math solver did not support voice Input Please type your question on console", "Voice inputs not allow to that function, please type your question on console", "for provide correct answer please type your question", ]
Respond_open: list = ["okay sure", "why not lets do it", "at your service"]
def Application_Knowledge(question: str):
try:
app_id = Config.API_Wolfram
client = wolframalpha.Client(app_id)
res = client.query(question)
answer = next(res.results).text
print('Answer = ', answer)
Speak.Speak('Your Answer ')
Speak.Speak(answer)
except:
pass
def Running_Math():
Speak.Speak(random.choice(Respond_open))
Speak.Speak(random.choice(Respond))
Question = input("Question : ")
Application_Knowledge(Question)