Question: PYTHON Homework 4 Could you please help me answer these questions? 1.) The default value for the GUI column Grid attribute is ____. a.) 0

PYTHON Homework 4 Could you please help me answer these questions?

1.) The default value for the GUI column Grid attribute is ____.

a.) 0 b.) False c.) "left" d.) "right"

2.) Consider the following program. What is displayed when it executes?

class Dinosaur :

def __init__(self, name="dinosaur") :

self._name = name

def display(self) :

print(self._name)

class Triceratops(Dinosaur) :

def __init__(self) :

super().__init__("triceratops")

x = Triceratops()

x.display()

a.) dinosaur b.) triceratops c.) Nothing is displayed d.) The program crashes with a method not implemented error

3.) In this code segment, root is ____.

ageValue = IntVar()

ageValue.set(100)

age = Entry(root, width=5, textvariable=ageValue)

a.) The containing element for the widget b.) the name of the event-handling function called when the element is clicked c.) the name of the variable that represent any data entered in the widget d.) is the name of the layout manager used by the widget

4.) Which of the following is true regarding subclasses?

a.) A subclass that inherits methods from its superclass may not override the methods. b.) A subclass that inherits instance variables from its superclass may not declare additional instance variables. c.) A subclass may inherit methods or instance variables from its superclass but not both. d.) A subclass may inherit methods and instance variables from its superclass, and may also implement its own methods and declare its own instance variables.

5.) A ____ exception is raised when Python attempts to convert a string with a bad format to a number.

a.) ConversionError b.) ValueError c.) ParsingError d.) FormatError

6.) A(n) ____ layout allows the GUI programmer to place components in the cells of an invisible grid in the window.

a.) cell b.) grid c.) MVC d.) model/view

7.) What is the purpose of using an inheritance hierarchy?

a.) To share common code among the classes b.) To create objects from concrete classes c.) To create objects from abstract classes d.) To create objects using constructors

8.) Given the following code, identify the subclass and superclass:

class ChoiceQuestion(Question) :

def __init__(self) :

. . .

a.) the subclass is Question, the superclass is ChoiceQuestion b.) the subclass is ChoiceQuestion, the superclass is Question c.) the subclass is init, the superclass is self d.) the subclass is ChoiceQuestion, the superclass is ChoiceQuestion

9.) Here the line Frame.__init__(self) indicates the superclass is Frame.

def __init__(self):

Frame.__init__(self)

self.master.title("KM 2 Miles")

self.grid()

a.) true b.) false

10.) Consider this checkbox code. When checked ____

self._cb1 = BooleanVar()

Checkbutton(self, text=beer, variable = _cb1, command = foop)

self._cb2 = BooleanVar()

Checkbutton(self, text=coffee, variable = _cb2, command = foop)

a.) which button is checked is determined using the variable value _cb1 or _cb2. b.) which button is checked is determined by the text property which is used to distinguish one button from another.

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 Databases Questions!