Above average
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
This one builds on a lesson you haven't finished yet. Do that lesson first: · 이 과제는 아직 완료하지 않은 수업에 기반합니다. 먼저 해당 수업을 완료하세요:
Python Basics · Functions →
English
Above average
Two loops, one after the other: the first works out the average, the second keeps the numbers above it.
This joins two patterns you have already used, the running total and the filter. Solving a problem in stages like this is how most longer programs are built.
한국어
평균 이상
두 개의 루프를 연이어 사용합니다: 첫 번째 루프는 평균을 계산하고, 두 번째 루프는 그 평균보다 큰 숫자들을 남깁니다.
이것은 이미 사용해 온 두 가지 패턴, 누적 합계와 필터를 결합한 것입니다. 이와 같이 단계를 나누어 문제를 해결하는 것이 대부분의 긴 프로그램을 만드는 방법입니다.
Write above_average(nums) that returns a list of the numbers greater than the average of nums, in their original order. The list is never empty.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.