def greet(name,msg="Good morning"):
return "hi~~"+ name +"."+ msg
print(greet("철수"))
print(greet("박","how do you do?"))
# 모든 인자가 디폴트 값
# 모든 인자가 디폴트 값 x
# 디폴트 값 인자가 뒤로
#예제2
def add1(a,b=10,c=15):
return a+b+c
print(f'ex2 결과:{add1(15)}')
print(f'ex2 결과:{add1(b=100,c=25,a=30)}')
#예제3
def add2(*d):
tot=0
for i in d:
tot +=i
return tot
print(f'ex3 결과:{add2(10,20,30)}')
print(f'ex3 결과:{add2(*(i for i in range(1,101)))}')