-
Notifications
You must be signed in to change notification settings - Fork 9
/
ex_03_1.py
24 lines (18 loc) · 672 Bytes
/
ex_03_1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
#AUTHOR: alexxa
#DATE: 24.12.2013
#SOURCE: Think Python: How to Think Like a Computer Scientist by Allen B. Downey
# http://www.greenteapress.com/thinkpython/html/index.html
#PURPOSE: Chapter 3. Functions
# Exercise 3.1. Move the last line of this program to the top,
# so the function call appears before the definitions. Run the
# program and see what error message you get.
#repeat_lyrics() # NameError: name 'repeat_lyrics' is not defined
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()
#END