After receiving a binary equation using the input function, are you trying to put each term except for the operator in a and b?
The result of input() comes in str format, and when str is divided by split(), the list of str is returned. When you divide by split(), if you don't give any parameters, you divide them by space.
So, if you take the 21.1000 + 30.000 input in the way that you write it down above, you'll see an Orgel called too many values to unpack. This means that you can't put a list in both variables, because dividing the input string by space results in a list with three elements: '21.1000', '+', and '30.000'.
A slight modification of the above source can cause a and b to have their respective values.
a, op, b=input ("Enter formulas (*for example, 20*40):").split()
So a has 21.1000, b has 30.000, and op has +.
© 2024 OneMinuteCode. All rights reserved.