I am writing "simple" calculator for checking my skills. The draft of project is: I decide to have a list appending with input of user to made a an arithmetic combination like
list_of_operation=["2","+","2","="]
if list_of_operation[-1] == "=":
for x in list_of_operation:
solve = float(list_of_operation[x])... <--- i know here is wrong
but i am not able to get a arithmetic operator from string the point of this is that
- the operation can grow like 2+2*2 so i use list
- the operation should see what should solve first like first multiplication than sum
- how to grab "+" as arithmetic operator??
- how to make list like arithmetic expression?
- how to make an arguments to grow the solve variable... etc
It is possible that i mess up this and use the wrong side to solve this but it is actual state of my knowledge. I beg you to not show me a solution of this only a path how to do this or which topic i should read to solve it. I want to learn not to rewrite a code. Thank u!