'''
print(max([10, 20, 30])) 최댓값
print(min([10, 20, 30])) 최솟값
'''

num = [10, 20, 30, 40, 50]
m = 0
for i in range(len(num)):
    if num[i] > m:
        m = num[i]
print(m)

#------------------------------
''' 합계를 구하는 함수
print(sum([10, 20, 30]))
'''

s = 0
num = [10, 20, 30]

for i in range(len(num)):
    s = s + num[i]

print(s)

#------------------------------
'''길이를 구하는 함수
print(len([1,2,3,4,5]))
print(len("helloworld!"))
'''

# 매개변수 O, 리턴 값 O
def add(a, b):
    return a + b

print(add(1, 2))

# 매개변수 O, 리턴 값 X
def add2(a, b):
    print(a+b)

add2(1, 2)

# 매개변수 X, 리턴 값 O
def add3():
    a = 10
    b = 20
    return a + b

print(add3())

#매개변수 X, 리턴 값 X
def add4():
    print(10 + 30)

add4()

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: