0
How can i repeat an operation
In calculators if you type 4 (times) 3 and press = it gives 12 (of course) and when you press it again it gives 36 and so on (because 4 times 3 is 12 and 12 times 3 is 36). How can i do this in python? (repeat an operation when the user wants to)
1 Answer
+ 2
Save the last used operator and operand in variables and whenever the user presses = again, apply operator and operand to the current result