Why does the following script give the error:
payIntList[i] = payIntList[i] + 1000
TypeError: 'map' object is not subscriptable
payList = []
numElements = 0
while True:
payValue = raw_input("Enter the pay amount: ")
numElements = numElements + 1
payList.append(payValue)
choice = raw_input("Do you wish to continue(y/n)?")
if choice == 'n' or choice == 'N':
break
payIntList = map(int,payList)
for i in range(numElements):
payIntList[i] = payIntList[i] + 1000
print payIntList[i]
payIntList = [int(x) + 1000 for x in payList]; print(*payIntList, sep='\n')(orfor x in payIntList: print xin Python 2.x whereprintisn't a function) without losing readability (arguably, it's even more readable). - user395760