파이썬 기초문법1 파이썬 기초문법 - 2 1. How to make a Function (A) 함수 정의하기 def 함수명(): (들여쓰기)실행문 *tab키를 이용하여 들여쓰기를 꼭 해야한다. (B) 함수 호출하기 함수명() *만약 함수명 뒤에 괄호()가 없으면 호출되지 않습니다. 2. Argument/Parameter(매개변수) 이용하기 (A) Argument를 이용한 함수 선언하기 def hello_to(Argument): print("Hello", Argument) ex) def hello_to(name): print("Hello", name) (B) 함수 호출하기 hello_to("Raphael") hello_to("Michael") *Argument 없이 함수를 호출할 경우 오류 발생 (C) default value를 가진 함수 만들기.. 2020. 7. 29. 이전 1 다음