꼬물꼬물 개발자
Return 본문
# Return Valuse 1
def tax_calc(money):
return money * 0.35
def pay_tax(tax):
print("thank you for paying", tax)
to_pay = tax_calc(150)
pay_tax(to_pay)
pay_tax(tax_calc(150))
# Return Valuse 2
my_name = "gowoon"
my_age = 42
my_color_eyes = "brown"
# f"{변수} + 문자열"
print(f"Hello I'm {my_name}, I have {my_age} years in the earth, {my_color_eyes} is my eye color")
# practice
def make_juice(fruit):
return f"{fruit}+🥤"
def add_ice(juice):
return f"{juice}+🧊"
def add_sugar(iced_juice):
return f"{iced_juice}+🍬"
fruit = "🍎"
juice = make_juice(fruit)
iced_juice = add_ice(juice)
perfect_juice = add_sugar(iced_juice)
print(perfect_juice)

'Python' 카테고리의 다른 글
while (0) | 2024.08.30 |
---|---|
input, and, or (0) | 2024.08.29 |
if, else, elif (0) | 2024.08.23 |
Functions (0) | 2024.08.22 |
Datatype (0) | 2024.08.21 |