Skip to content

Secuence is not cleared after operation completed #15

@3rdPix

Description

@3rdPix

Describe the bug
When solving an operation and the result is displayed, it is possible to enter new number. These new numbers are appended at the end of the string representing the result and are not treated as new numbers. This causes conflicts after trying to add an operator and calculating new results.

To Reproduce
Steps to reproduce the behavior:

  1. Write a number and calculate any operation
  2. When the result is shown on screen, write new numbers. These numbers will be appended at the end of the shown result
  3. Try to get the result by pressing enter
  4. See error
Traceback (most recent call last):
  File "D:\gui_calculator\calculator_main.py", line 296, in equal
    temp_val1 = str(result)  # Store the result in temp_val1.
                    ^^^^^^
UnboundLocalError: cannot access local variable 'result' where it is not associated with a value

Expected behavior
It should be decided whether after solving an operation the result remains and can be used to work on new operations, or it should be cleared if new numbers are typed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions