반응형
def hello():
print("Hello!")
print("Welcome to Codeit!")
# 함수를 정의 한다. 특별히 어떤 일이 일어나지 않는다.
print("함수 호출 전")
hello() # 함수를 실행해라 == 함수를 호출 해라
print("함수 호출 후")
def square(x):
return x * x
print("함수 호출 전")
print(square(3) + square(4)) # (3*3+4*4) == (9 + 16) == 25가 출력된다.
print("함수호출 후")
728x90
반응형
'교육 > [Codeit] 프로그래밍 기초 in Python' 카테고리의 다른 글
return과 print 차이 (0) | 2020.11.06 |
---|---|
return문 제대로 이해하기 (0) | 2020.11.06 |
변수 제대로 이해하기 (0) | 2020.11.06 |
type 함수 (0) | 2020.11.06 |
불 대수, 불린형 (0) | 2020.11.05 |