############################################################################## # decisions.py # # Jeff Ondich, 9/4/07 # # This program illustrates how a Python program can make decisions about # how to proceed based on input provided by a person. # # Try running the program four times, providing input that will lead # to each of the four possible output messages shown below. ############################################################################## intString = raw_input('What is your favorite integer? ') favoriteInteger = int(intString) if favoriteInteger < 10: print 'What a little integer!' elif favoriteInteger == 1729: print 'That is the smallest integer expressible as the sum of two cubes in two different ways.' print '(See http://en.wikipedia.org/wiki/1729_(number) for a story about some scintillating' print 'sick-bed conversation between two famous mathematicians.)' elif favoriteInteger > 1000: print 'Too big for me.' else: print 'I have always loved that integer.'