@@ -7,14 +7,14 @@ def sort_words(words):
77 """Sorts the words."""
88 return sorted (words )
99
10- def print_first_word (words )
10+ def print_first_word (words ):
1111 """Prints the first word after popping it off."""
12- word = words .poop (0 )
12+ word = words .pop (0 )
1313 print word
1414
1515def print_last_word (words ):
1616 """Prints the last word after popping it off."""
17- word = words .pop (- 1
17+ word = words .pop (- 1 )
1818 print word
1919
2020def sort_sentence (sentence ):
@@ -43,7 +43,7 @@ def print_first_and_last_sorted(sentence):
4343with logic so firmly planted
4444cannot discern \n the needs of love
4545nor comprehend passion from intuition
46- and requires an explantion
46+ and requires an explanation
4747\n \t \t where there is none.
4848"""
4949
@@ -52,40 +52,40 @@ def print_first_and_last_sorted(sentence):
5252print poem
5353print "--------------"
5454
55- five = 10 - 2 + 3 - 5
55+ five = 10 - 2 + 3 - 6
5656print "This should be five: %s" % five
5757
5858def secret_formula (started ):
5959 jelly_beans = started * 500
60- jars = jelly_beans \ 1000
60+ jars = jelly_beans / 1000
6161 crates = jars / 100
6262 return jelly_beans , jars , crates
6363
6464
6565start_point = 10000
66- beans , jars , crates == secret_formula (start - point )
66+ beans , jars , crates = secret_formula (start_point )
6767
6868print "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 )
7070
7171start_point = start_point / 10
7272
7373print "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 )
7575
7676
77- sentence = "All god \t things come to those who weight ."
77+ sentence = "All good \t things come to those who wait ."
7878
79- words = ex25 . break_words (sentence )
80- sorted_words = ex25 . sort_words (words )
79+ words = break_words (sentence )
80+ sorted_words = sort_words (words )
8181
8282print_first_word (words )
8383print_last_word (words )
84- . print_first_word (sorted_words )
84+ print_first_word (sorted_words )
8585print_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
8888
89- print_irst_and_last (sentence )
89+ print_first_and_last (sentence )
9090
91- print_first_a_last_sorted (senence )
91+ print_first_and_last_sorted (senence )
0 commit comments