Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

꼬물꼬물 개발자

Return 본문

Python

Return

한고운 2024. 8. 22. 01:23

# 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