Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 1.2.2 >>> ================================ RESTART ================================ >>> >>> p1 ('Fred Smith', 'USA', 15) >>> p2 ('Chen Ji', 'USA', 42) >>> p3 ('Silvio Berlesconi', 'Italy', 72) >>> p4 ('Bill Gates', 'USA', 53) >>> isUSCitizen(p2) name isChen Ji Traceback (most recent call last): File "", line 1, in isUSCitizen(p2) File "/Users/pconrad/CS5NM/10.29/citizenshipExampleFrom1029.py", line 14, in isUSCitizen print "he/she is a citizen of " + citzenship NameError: global name 'citzenship' is not defined >>> ================================ RESTART ================================ >>> >>> ================================ RESTART ================================ >>> >>> isUsCitizen(p2) Traceback (most recent call last): File "", line 1, in isUsCitizen(p2) NameError: name 'isUsCitizen' is not defined >>> isUSCitizen(p2) name is Chen Ji he/she is a citizen of USA Traceback (most recent call last): File "", line 1, in isUSCitizen(p2) File "/Users/pconrad/CS5NM/10.29/citizenshipExampleFrom1029.py", line 15, in isUSCitizen print "that person is " + age + " years old" TypeError: cannot concatenate 'str' and 'int' objects >>> 4 4 >>> type(4) >>> str(4) '4' >>> x = str(4) >>> x '4' >>> type(x) >>> x '4' >>> x + 2 Traceback (most recent call last): File "", line 1, in x + 2 TypeError: cannot concatenate 'str' and 'int' objects >>> y = int(x) + 2 >>> z = x + str(2) >>> y 6 >>> z '42' >>> fname="Tina" >>> lname = "Fey" >>> fname + lname 'TinaFey' >>> fname + " " + lname 'Tina Fey' >>> addrNum = "1600" >>> street = "Pennsylvania Ave" >>> whiteHouseAddr = addrNum + " " + street >>> whiteHouseAddr '1600 Pennsylvania Ave' >>> whiteHouseAddr '1600 Pennsylvania Ave' >>> wuzzup = "How ya doin'" >>> wuzzup "How ya doin'" >>> whiteHouseAddr '1600 Pennsylvania Ave' >>> ================================ RESTART ================================ >>> >>> isUSCitizenVersion2("Goose","USA",24) True >>> isUSCitizen(p2) name is Chen Ji he/she is a citizen of USA that person is 42 years old True >>> ================================ RESTART ================================ >>> >>> isUSCitizenVersion3(p2) True >>> ================================ RESTART ================================ >>> >>> isOldEnoughToVote(p2) True >>> p2 ('Chen Ji', 'USA', 42) >>> isOldEnoughToVote(p1) False >>> p1 ('Fred Smith', 'USA', 15) >>>