-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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:
- Write a number and calculate any operation
- When the result is shown on screen, write new numbers. These numbers will be appended at the end of the shown result
- Try to get the result by pressing enter
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels