정보처리기사 2021년 2회 64번

IT 위키

과목: 프로그래밍 언어 활용

1 문제[편집 | 원본 편집]

64. 다음 파이썬(Python) 프로그램이 실행되었을 때의 결과는?

class FourCal:
def setdata(sel, fir, sec):
sel.fir=fir
sel.sec=sec
def add(sel):
result=sel.fir+sel.sec
return result
a=FourCal()
a.setdata(4, 2)
print(a.add( ))

  • ① 0
  • ② 2
  • ③ 4
  • ④ 6

2 풀어보기[편집 | 원본 편집]

3 정답[편집 | 원본 편집]

  • 4번

4 해설[편집 | 원본 편집]

5 같이 보기[편집 | 원본 편집]