인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

ohchaehyun4119's profile image
ohchaehyun4119

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

Brief knowledge (global and local variables)

변수 질문입니다.

Written on

·

207

0

안녕하세요. 강의를 듣다가 질문글 남깁니다.
프로그래머스에서 문제를 풀면서
 
ex) -------문제-------
def fun1(money, cost):
 
return answer
------------------------
위와 같은 문제에서, 제가 임의로 def fun2을 만들어서 money와 cost변수를 사용하고싶을때는
fun1 함수내에 fun2(money,cost) 와 같이 작성하여 변수를 넘겨줘야만 사용할수 있나요? 다른 방법이 있는지 궁금합니다.!
 
 
 
python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

매개변수로 넘겨주는게 좋을 것 같습니다.

ohchaehyun4119's profile image
ohchaehyun4119

asked

Ask a question