#함수 : 특정 기능을 실행하는 코드 또는 코드의 모임
#내장 함수 : print(), input(), len(), int(), str(), type()

#사용자 정의 함수(내가 만드는 함수)
'''
def 함수 이름(매개변수):
    함수를 불렀을 때 실행할 명령들
'''

def 라면_만들기():
    print('냄비에 물을 넣는다')
    print('물을 끓인다')
    print('봉지를 뜯는다')
    print('면과 스프를 넣는다')
    print('계란을 넣는다')
    print('그릇에 넣는다')

라면_만들기()
라면_만들기()

#매개변수 : 함수 안에서 사용하는 변수
def hello(name):
    print(name + '아, 안녕!')

hello('지안')
hello('의준')

def total(a, b):
    print(a + b)

total(1262, 2173)
total(12, 31)

print('----문제1----')
def mul(a,b,c):
    print(a * b * c)

mul(15,4,8)

print('----문제2----')
def 점수(score):
    if score >= 60:
        print("합격입니다")
    else:
        print("불합격입니다")

점수(50)
점수(60)

Embed on website

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