정보처리기사 2021년 2회 64번: 두 판 사이의 차이
IT위키
Maintenance script (토론 | 기여) (Imported from text file) |
(차이 없음)
|
2022년 10월 22일 (토) 01:00 기준 최신판
과목: 프로그래밍 언어 활용
문제[편집 | 원본 편집]
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
풀어보기[편집 | 원본 편집]
정답[편집 | 원본 편집]
- 4번