3.5 정의와 사용
앞 절에서 사용한 코드 조각을 모두 모아서 다음과 같이 전체 프로그램으로 만들었다.
def print_lyrics():
print("I'm a lumberjack, and I'm okay.")
print("I sleep all night and I work all day.")
def repeat_lyrics():
print_lyrics()
print_lyrics()
repeat_lyrics()
앞 절에서 사용한 코드 조각을 모두 모아서 다음과 같이 전체 프로그램으로 만들었다.
def print_lyrics():
print("I'm a lumberjack, and I'm okay.")
print("I sleep all night and I work all day.")
def repeat_lyrics():
print_lyrics()
print_lyrics()
repeat_lyrics()