@@ -7,14 +7,14 @@ def sort_words(words):
7
7
"""Sorts the words."""
8
8
return sorted (words )
9
9
10
- def print_first_word (words )
10
+ def print_first_word (words ):
11
11
"""Prints the first word after popping it off."""
12
- word = words .poop (0 )
12
+ word = words .pop (0 )
13
13
print word
14
14
15
15
def print_last_word (words ):
16
16
"""Prints the last word after popping it off."""
17
- word = words .pop (- 1
17
+ word = words .pop (- 1 )
18
18
print word
19
19
20
20
def sort_sentence (sentence ):
@@ -43,7 +43,7 @@ def print_first_and_last_sorted(sentence):
43
43
with logic so firmly planted
44
44
cannot discern \n the needs of love
45
45
nor comprehend passion from intuition
46
- and requires an explantion
46
+ and requires an explanation
47
47
\n \t \t where there is none.
48
48
"""
49
49
@@ -52,40 +52,40 @@ def print_first_and_last_sorted(sentence):
52
52
print poem
53
53
print "--------------"
54
54
55
- five = 10 - 2 + 3 - 5
55
+ five = 10 - 2 + 3 - 6
56
56
print "This should be five: %s" % five
57
57
58
58
def secret_formula (started ):
59
59
jelly_beans = started * 500
60
- jars = jelly_beans \ 1000
60
+ jars = jelly_beans / 1000
61
61
crates = jars / 100
62
62
return jelly_beans , jars , crates
63
63
64
64
65
65
start_point = 10000
66
- beans , jars , crates == secret_formula (start - point )
66
+ beans , jars , crates = secret_formula (start_point )
67
67
68
68
print "With a starting point of: %d" % start_point
69
- print "We'd have %d jeans , %d jars, and %d crates." % (beans , jars , crates )
69
+ print "We'd have %d beans , %d jars, and %d crates." % (beans , jars , crates )
70
70
71
71
start_point = start_point / 10
72
72
73
73
print "We can also do that this way:"
74
- print "We'd have %d beans, %d jars, and %d crabapples ." % secret_formula (start_pont
74
+ print "We'd have %d beans, %d jars, and %d crates ." % secret_formula (start_point )
75
75
76
76
77
- sentence = "All god \t things come to those who weight ."
77
+ sentence = "All good \t things come to those who wait ."
78
78
79
- words = ex25 . break_words (sentence )
80
- sorted_words = ex25 . sort_words (words )
79
+ words = break_words (sentence )
80
+ sorted_words = sort_words (words )
81
81
82
82
print_first_word (words )
83
83
print_last_word (words )
84
- . print_first_word (sorted_words )
84
+ print_first_word (sorted_words )
85
85
print_last_word (sorted_words )
86
- sorted_words = ex25 . sort_sentence (sentence )
87
- prin sorted_words
86
+ sorted_words = sort_sentence (sentence )
87
+ print sorted_words
88
88
89
- print_irst_and_last (sentence )
89
+ print_first_and_last (sentence )
90
90
91
- print_first_a_last_sorted (senence )
91
+ print_first_and_last_sorted (senence )
0 commit comments