repl.it
@Juice99/

Calculator

Python

No description

fork
loading
Files
  • main.py
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
import replit

again = "again";again = True
symbols = ["+", "-", "*", "/", "^", "(", ")"]
y = 0

def addition(*args):
	print(*args)

def order(equat):
	if equat == ("i"):
		return()
	else:
		for x in eq_list:
			try:
				x = int(x)
			except:
				if x == "+":
					addition(eq_list[x-1],eq_list[x+1])
		print(equat)

	pause = input()

def check(eq_list):
	while y == 0:
		for x in eq_list:
			try:
				x = int(x)
				print("%i is an int" %x)
			except:
				if x not in symbols:
					print("%s is not valid" %x)
					eq_list = ("i")
				else:
					print("%s is a symbol" %x)
					pass
	order(eq_list)




while again == True:
	replit.clear()
	equation = input(str("Enter an equation you want calculated: "))
	eq_list = equation.split(" ")
	check(eq_list)
?