사소하고 흔한 차이 - '매개변수'와 '인자'

Gomi_kery·2022년 9월 16일
0

기타

목록 보기
4/7
post-thumbnail

매개 변수 (Parameter)

  • 메서드, 함수를 정의할 때 사용되는 변수.

인자 (Argument)

  • 메서드, 함수를 호출될 때 전달되는 실제 값.

def interest (money, total_months):
    total_money = money * total_months
    return  total_money * 0.3

interest(20000,24)
  • def interest(): 의 money, total_months는 매개 변수.
  • interest() 의 20000, 24는 인자.
profile
QA. 손으로 할 수 있는 모든 것을 좋아합니다.

0개의 댓글