return jelly_beans, jars, crates start_point = 10000 beans, jars, crates = secret_formula(start_point) # _ is missing here and == is used instead of = print "With a starting point of: %d" % start_point print "We'd have %d jeans, %d jars, and %d crates." % (beans, jars, crates) start_point = start_point / 10 print "We can also do that this way:" print "We'd have %d beans, %d jars, and %d crabapples." % secret_formula(start_point) # ')' , is missing in this statement and alse spelling misteke sentence = "All good\tthings come to those who weight." #spell mistake here , good not god words = Ex25.break_words(sentence) # again spelling mistake Ex25 is correct sorted_words = Ex25.sort_words(words) print_first_word(words) print_last_word(words) print_first_word(sorted_words) # . extra dot is used print_last_word(sorted_words) sorted_words = Ex25.sort_sentence(sentence) print sorted_words # spelling mistake here print not rint print_first_and_last(sentence) # spelling mistake of first print_first_and_last_sorted(sentence) # spellind mistake and is used here not a and sentence is also spell wrong
return jelly_beans, jars, crates start_point = 10000 beans,jars,crates = secret_formula(start_point)#....这里一发==把我眼看瞎了才看出来我日 print "With a starting point of: %d" % start_point print "We'd have %d beans, %d jars, and %d crates." % (beans,jars,crates) start_point = start_point / 10 print "We can also do that this way:" print "We'd have %d beans, %d jars, and %d crabapples." % secret_formula(start_point) sentence = "All god\tthings come to those who weight." words = Ex25.break_words(sentence) sorted_words = Ex25.sort_words(words) print_first_word(words) print_last_word(words) print_first_word(sorted_words) print_last_word(sorted_words) sorted_words = Ex25.sort_sentence(sentence) print sorted_words print_first_and_last(sentence) print_first_and_last_sorted(sentence)
import Ex25 sentence = "All good things come to those who wait." words = Ex25.break_words(sentence) print(words) sorted_words = Ex25.sort_words(words) print(sorted_words) Ex25.print_first_word(words) Ex25.print_last_word(words) print(words) Ex25.print_first_word(sorted_words) Ex25.print_last_word(sorted_words) print(sorted_words) sorted_words = Ex25.sort_words(sentence) print(sorted_words) Ex25.print_first_word(sorted_words) Ex25.print_last_word(sorted_words) Ex25.print_first_and_last_sorted(sentence)