Python - 일반함수, 멤버함수

def 함수명(매개변수) : 
	실행문
	return 값

매개변수

def max(a,b) : 
	if a > b :
		print(a, ':', '크다')
	elif b > a :
		print(b, ':', '크다')
	else :
		print('같다')

---------------------

max(5,5)
max(2,4)
....

return

def min(a, b) :
	if a < b :
		return str(a) + ':' + '작다'
	elif b < a : 
		return str(b) + ':' + '작다'
	else :
		return '같다'
---------------------
print(min(5,5))
print(min(5,2))
---------------------

def calculator(a,b) : 
	return (a+b, a-b, a*b, a/b)

plus, minus, mul, div = calculator(3, 7)

print(plus, minus, mul, div)

VarArgs 매개변수