We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 471f626 commit 62610ebCopy full SHA for 62610eb
calculator.py
@@ -128,11 +128,12 @@ def put_dot(self):
128
self.ponto = False
129
130
def erase(self):
131
- if(not self.error):
132
- if self.equation[-1] == '.':
133
- self.ponto = True
134
- self.equation = self.equation[:-1]
135
- self.update_screen()
+ if(len(self.equation) > 0):
+ if(not self.error):
+ if self.equation[-1] == '.':
+ self.ponto = True
+ self.equation = self.equation[:-1]
136
+ self.update_screen()
137
138
def clean(self):
139
self.equation = ''
@@ -171,6 +172,10 @@ def equal(self):
171
172
173
finally:
174
self.lastvar.set(eq)
175
+
176
+ if ('.' in self.equation):
177
+ self.ponto = False
178
179
self.update_screen()
180
181
Calculadora()
0 commit comments