-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07-functions.py
More file actions
50 lines (42 loc) · 995 Bytes
/
07-functions.py
File metadata and controls
50 lines (42 loc) · 995 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 함수 functions
# 입력값 parameters, 반환값 return
def hello_friends(name):
print("hello, {}".format(name))
name1 = "marco"
name2 = "jane"
name3 = "john"
name4 = "tom"
name5 = "marco"
name6 = "jane"
name7 = "john"
name8 = "tom"
# print("hi, {}".format(name1))
# print("hi, {}".format(name2))
# print("hi, {}".format(name3))
# print("hi, {}".format(name4))
# print("hi, {}".format(name5))
# print("hi, {}".format(name6))
# print("hi, {}".format(name7))
# print("hi, {}".format(name8))
hello_friends(name1)
hello_friends(name2)
hello_friends(name3)
hello_friends(name4)
hello_friends(name5)
hello_friends(name6)
hello_friends(name7)
hello_friends(name8)
# 1) 입력값 o, 반환값 o
def sum(a, b):
return a + b
# 2) 입력값 o, 반환값 x
def hello_friends(name):
print("hello, {}".format(name))
# 3) 입력값 x, 반환값 o
def return_1():
return 1
# 4) 입력값 x, 반환값 x
def hello_world():
print("hello world")
# num_1 = return_1()
# print(num_1)