지연 평가
Python이 아래 스크립트를 실행할 때, 'Converting to percentage' 메시지가 출력되는 시점은 어느 줄인가요?
from dask import delayed
def fraction_to_percent(x):
percentage = x * 100
print('Converting to percentage')
return x
frac = 0.3
percentage = delayed(fraction_to_percent)(frac)
computed_percentage = percentage.compute()
print(percentage)
print(computed_percentage)
정답을 찾는 데 콘솔을 활용하셔도 됩니다. fraction_to_percent() 함수는 이 세션에 이미 준비되어 있어요.
이 연습은 강의의 일부입니다
