추상화 : 복잡한 내용은 숨기고, 주요 기능에만 신경 쓰자
변수, 함수, 객체
가 이에 해당 된다.
변수
: 값을 저장하는 것 / 정의함
함수
: 명령을 저장하는 것
- 내장 함수 : 미리 함수값 구현해놓음 (ex.print())
def
= 정의하겠다. 의미 함수def hello(): # 헤더
print("hello!")
print("Welcome to codeit!")
hello()
def hello(name #파라미터):
print("hello")
print(name)
print("Welcom to codeit")
hello("Chris") # 파라미터 값 노출
+) 여러개 파라미터 호출 시 변수에 ,로 구분하여 표시def print_sum(a, b, c):
print(a + b + c)
print_sum(7, 3, 2)
def sum_something(x, y):
return x + y #x,y 값 반환하여
print(sum_something(3, 4) + 3) # 반환 값 출력한다.