# squareEach-6.11.py # Return the squares of an input list without modifying the input list # Neal Nelson 2007.10.30 def squareEach(nums): # Start a new list to put the squares into squares = [] for i in range(len(nums)): squares.append(nums[i] ** 2) return squares def main(): nums = input("Enter a list of numbers with brackets, eg, [4,6,8] :") print nums # should print eg [4,6,8] print "Squaring this list gives:", squareEach(nums) print nums # should print eg [4,6,8] main()