혼공파 매개변수
-
50 - 함수, 매개변수 기본study with Q - 파이썬 2024. 6. 2. 18:15
# 외워...! ~기본적인 함수~def p_3_ts(): print("hey") print("hey") print("hey")# 그리고 함수를 호출(call)하면p_3_ts()>>>heyheyhey # 파이썬에서 매개변수 : 함수의 괄호 안에 넣는 변수 def f_str(str): print(str) print(str) print(str)f_str("seven")>>>sevensevenseven # parameter(매개변수) : 함수 정의 때 넣은 변수 (위에서 str)# argument(인수) : 함수 호출 때 넣은 값 (위에서 seven) # 문자열과 횟수도 넣을 수 있어요# parameterdef prt(str, times): for i in range(times) : print..