다음 Python 프로그램의 실행 결과를 쓰시오.
1class Animal:2 def sound(self):3 return "소리"4 5 6class Cat(Animal):7 def sound(self):8 return "야옹"9 10 11class Cow(Animal):12 pass13 14 15a = Cat()16b = Cow()17x = a.sound()18y = b.sound()19print(x, y)
class Animal:
def sound(self):
return "소리"
class Cat(Animal):
return "야옹"
class Cow(Animal):
pass
a = Cat()
b = Cow()
x = a.sound()
y = b.sound()
print(x, y)
해설을 먼저 보면 이후 정답 시 점수가 50%만 반영됩니다.