In Python ... What does the following code fragment print? class Shape: def __in
ID: 657929 • Letter: I
Question
In Python ...
What does the following code fragment print?
class Shape:
def __init__ (self, size):
self.size = 10
class Trangle (Shape):
def getSize (self):
size = 12
return self.size
pythagores = Triangle ()
print (pythagores.getSize ())
What does the following code fragment print?
class Shape:
def __init__ (self, size):
self.size = 10
class Trangle (Shape):
def getSize (self):
size = 12
return self.size
pythagores = Triangle ()
print (pythagores.getSize ())
Explanation / Answer
screen print=12;
memory got the block of size.
then call accepted through the self.size dunction
it will call to the size block memory
it will got the address and print on the screen 12 .
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.