Here is the code I have, and the error.I don't understand the TUPLE problem. Can someone explain.
#Main Program def main(): notGreenCost = (12,float) goneGreenCost = (12, float) savings = (12, float) months = "January ","February","March ","April ","May ","June ","July ","August ","September ","October ","November ","December " for index in range(12): print "Enter NOT GREEN energy costs for ", months[index] notGreenCost[index]=raw_input("Enter now-> ") for index in range(12): print "Enter GONE GREEN energy costs for ", months[index] goneGreenCost[index]=input("Enter now-> ") print "--------------------------------------- " print "SAVINGS NOT GREEN GONE GREEN MONTH" print "--------------------------------------- " for index in range(12): savings[index] = notGreenCost(index) - goneGreenCost[index] print "$ ", savings[index] print "$ ", notGreenCost[index] print "$ ", goneGreenCost[index] print months[index] main() Enter NOT GREEN energy costs for January Enter now-> 0 Traceback (most recent call last): File "C:\Users\USER\Desktop\P08.py", line 24, in <module> main() File "C:\Users\USER\Desktop\P08.py", line 11, in main notGreenCost[index]=raw_input("Enter now-> ") TypeError: 'tuple' object does not support item assignment >>>
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor