-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDerivative Calculator.py
59 lines (48 loc) · 1.33 KB
/
Derivative Calculator.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
print("This program is made by Mirbalaj Rishi")
print("")
userInput = input("Please, input your function: ")
list = []
constant = ""
variable = ""
letter = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "n", "m", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
number = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
"""
def numbercheck(n):
try:
x = int(n)
return int(n)
except:
x = n
"""
def numberCheck2(n):
number = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
num = ""
if n in number:
num += n
return num
else:
return "no"
def letterCheck(l):
letter = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "n", "m", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
let = ""
if l in letter:
let += l
return let
else:
return "no"
def symbolsCheck(i):
if numberCheck2(i)!= "no":
return numberCheck2(i)
elif letterCheck(i)!="no":
return letterCheck(i)
else:
return "nothing"
orginialList = []
for i in userInput:
list.append(symbolsCheck(i))
for i in list:
if i in number:
variable = int(i)
if i in letter:
constant = 1
print(variable*constant)