Skip to content

Commit f1d8ef5

Browse files
committed
some variable names changes
1 parent 62610eb commit f1d8ef5

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

calculator.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class Calculadora:
44
def __init__(self):
5-
self.ponto = True
5+
self.dot = True
66
self.error = False
77
self.root = Tk()
88
self.config_window()
@@ -29,9 +29,9 @@ def create_screen(self):
2929
self.result_frame = Frame(self.screen_frame, bg='#2c2c2c')
3030
self.result_frame.place(relx=0, rely=0.5, relwidth=1, relheight=0.5)
3131

32-
self.resultLabel = Label(self.result_frame, textvariable=self.eqvar,
32+
self.result_label = Label(self.result_frame, textvariable=self.eqvar,
3333
bg='#2c2c2c', fg='#ffffff', font=(None, 18), anchor="e")
34-
self.resultLabel.pack(side = RIGHT, padx=20, pady=(20, 10))
34+
self.result_label.pack(side = RIGHT, padx=20, pady=(20, 10))
3535

3636

3737
#Lastequation
@@ -41,15 +41,15 @@ def create_screen(self):
4141
self.lasteq_frame = Frame(self.screen_frame, bg='#2c2c2c')
4242
self.lasteq_frame.place(relx=0, rely=0, relwidth=1, relheight=0.5)
4343

44-
self.lasteqLabel = Label(self.lasteq_frame, textvariable=self.lastvar,
44+
self.lasteq_label = Label(self.lasteq_frame, textvariable=self.lastvar,
4545
bg='#2c2c2c', fg='#777777', font=(None, 18), anchor="e")
46-
self.lasteqLabel.pack(side = RIGHT, padx=20, pady=(30, 0))
46+
self.lasteq_label.pack(side = RIGHT, padx=20, pady=(30, 0))
4747

4848

4949
def create_buttons(self):
5050
# Row 1
51-
self.ac = Button(self.button_frame, text='C', command=self.clean)
52-
self.ac.place(relx=0, rely=0, relwidth=0.5, relheight=0.2)
51+
self.bac = Button(self.button_frame, text='C', command=self.clean)
52+
self.bac.place(relx=0, rely=0, relwidth=0.5, relheight=0.2)
5353

5454
self.berase = Button(self.button_frame, text='⌫', command=self.erase)
5555
self.berase.place(relx=0.5, rely=0, relwidth=0.25, relheight=0.2)
@@ -118,27 +118,27 @@ def put_symbol(self, symbol):
118118

119119
def operator(self, symbol):
120120
if(not self.error):
121-
self.ponto = True
121+
self.dot = True
122122
self.put_symbol(symbol)
123123

124124
def put_dot(self):
125125
if(not self.error):
126-
if(self.ponto):
126+
if(self.dot):
127127
self.put_symbol('.')
128-
self.ponto = False
128+
self.dot = False
129129

130130
def erase(self):
131131
if(len(self.equation) > 0):
132132
if(not self.error):
133133
if self.equation[-1] == '.':
134-
self.ponto = True
134+
self.dot = True
135135
self.equation = self.equation[:-1]
136136
self.update_screen()
137137

138138
def clean(self):
139139
self.equation = ''
140140
self.error = False
141-
self.ponto = True
141+
self.dot = True
142142
self.lastvar.set('')
143143
self.update_screen()
144144

@@ -174,7 +174,7 @@ def equal(self):
174174
self.lastvar.set(eq)
175175

176176
if ('.' in self.equation):
177-
self.ponto = False
177+
self.dot = False
178178

179179
self.update_screen()
180180

0 commit comments

Comments
 (0)