(Solved):PYTHON 1.) What is the name of the method in the following code segment? class Fruit : def getColor(self) : return self.color a.) color b.) Fruit c.) getColor d.) self 2.) Consider the following c… View Answer…

 

Question

PYTHON

1.) What is the name of the method in the following code segment? class Fruit : def getColor(self) : return self._color

a.) _color

b.) Fruit

c.) getColor

d.) self

 

2.) Consider the following code segment. ___is a class variable. class Fruit : _type = “Fruit” def __init__(self, color) : self._color = color

a.) color

b.) _color

c.) self

d.) _type

 

3.) Which of the following is NOT a difference between methods and functions?

a.) A method is defined as part of

Scroll to top