728x90
반응형

total = 0
def money(t, price):
t += price # 인수 total(t)에 가격 더하기
return t # 리턴 값
total = money(total, 3000)
total = money(total, 2000)
total = money(total, 1500)
print(total)
결과
6500728x90
반응형
'프로그램' 카테고리의 다른 글
| [파이썬] iris.csv 분류 (tensorflow 기초) (0) | 2022.11.29 |
|---|---|
| [파이썬] 문제 : 리스트 삭제 함수(destination, 경복궁 등) (0) | 2022.11.29 |
| [파이썬] 문제 : 함수로 리스트에 추가하기 (0) | 2022.11.29 |
| [파이썬] 문제 : nxn 다차원 배열에서 0,1이 체크판 패턴 만들기 (0) | 2022.11.29 |
| [파이썬] 문제 : Text파일의 단어 빈도수(konlpy) (0) | 2022.11.29 |
댓글