Quiz 03 Solution

Using Python's Built-in Types

response = raw_input('Enter two integers: ')   # response is a str instance
pieces = response.split()                      # pieces is a list of str instances
total = int(pieces[0]) + int(pieces[1])        # total is an integer
print 'Their sum is',  str(total) + '.'        # Note that period is immediately after the total

Last modified: Thursday, 04 February 2010