먼저 생각하기 · 기초
다음 모습 예상하기: 두 코드 책이 준비 중 서로를 다시 찾는 연결을 풀어요
생활 장면은 이래요. 가격 책과 할인 책이 서로의 아직 빈 칸을 먼저 읽으려 해요. 다음 모습을 먼저 예상하고 짧은 Python 코드, 즉 컴퓨터가 따라 할 글로 확인합니다.
아래 글을 아직 컴퓨터가 따라 하게 하지 말고, 마지막에 보일 모습과 그렇게 생각한 까닭을 먼저 적으세요. import types price = types.ModuleType("price") discount = types.ModuleType("discount") price.other = discount discount.other = price print(discount.other is price)
- 첫 글: import types price = types.ModuleType("price") discount = types.ModuleType("discount") price.other = discount discount.other = price print(discount.other is price)
- 공개 풀이를 보기 전에 예상과 그렇게 생각한 까닭을 먼저 적습니다.
- 실제 이름·연락처·계정 정보 대신 수업용 글자와 작은 수만 사용합니다.
연습과 같은 문제를 다시 풀어 보는 시간이에요. 힌트 없이 먼저 생각해 보세요. 지금 적은 답은 바로 합격으로 기록되지 않아요.
