강의

멘토링

커뮤니티

Inflearn Community Q&A

josohyun05204895's profile image
josohyun05204895

asked

Introduction to Python for Programming and Data Science

Function Concept I

함수 입력순서

Written on

·

222

0

함수 입력순서에 대해서 질문이 있습니다. 

 

함수 수행 순서를 듣고 결국에 print부분을 컴퓨터가 먼저 인식한다고 생각해서, 그럼 함수와 print부분을 바꿔도 인식 순서에는 영향을 주지 않을거라고 생각해서 

 

 

 

def d_rectangle_area(x,y) :

 

    return(x*y)

 

print(d_rectangle_area(5,7))

 

이렇게 되어 있던 것을 

 

 

 

print(d_rectangle_area(5,7))

 

def d_rectangle_area(x,y) :

 

    return(x*y)

 

이렇게 바꿔봤어요 이게 더 컴퓨터가 인식하기에 효율적일거라고 생각해서요. 근데 에러뜨던데 함수를 결과값보다 항상 먼저 입력해야 하는 이유가 있나요? 

bigdatapython

Answer 2

0

josohyun0520님의 프로필 이미지
josohyun0520
Questioner

감사합니당 

0

TeamLab님의 프로필 이미지
TeamLab
Instructor

메모리에 올리는 순서로 사용하기 전에 메모리에 로딩 되어야 합니다. 인터프린터 언어의 특징입니다.

josohyun05204895's profile image
josohyun05204895

asked

Ask a question