Def1 python 2일차 / function / def / parameters / arguments / return values / format / f"" # 2.4 Functions # function 을 정의할 때 def 를 쓴다. # 변수와 마찬가지로 숫자로 시작하면 안되고 스네이크 케이스를 쓴다 def say_hello(user_name, user_age): # parameter print("hello", user_name, "how r u ?") print("you are", user_age, "years old.") # 2.5 Identation # python에선 공백이 매우 중요하다. # 코드를 두칸 띄워줘야 그 코드가 어떤것 안에 들어가 있는걸 알수있다. def say_bye(): print("bye~") say_bye() # 2.6 Parameters # parameter: function의 괄호 안에서 쓰는 인자 # argument: f.. 2023. 1. 2. 이전 1 다음 반응형