Question: Given the following window class, what type of variable is result? class Demo ( EasyFrame ) : def _ _ init _ _ ( self

Given the following window class, what type of variable is result?
class Demo(EasyFrame):
def __init__(self):
"""Sets up the window and widgets."""
EasyFrame.__init__(self, title = "Demo", width =600)
self.addLabel(text ="An integer", row =0, column =0)
self.inputField = self.addFloatField(value =0.0,row =0, column =1)
self.addLabel(text = "Square root", row =1, column =0)
self.outputField = self.addFloatField(value =0.0, row =1, column =1, precision =3, state = "readonly")
self.addButton(text = "Compute", row =2, column =0, columnspan =2, command = self.computeSqrt)
self.count =0
def computeSqrt(self):
number = self.inputField.getNumber()
result = math.sqrt(number)
self.outputField.setNumber(result)
self.count +=1
Question 27 options:
a)
constant variable
b)
local variable
c)
instance variable
d)
string variable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!