Here's the error I get for i in range(len(n))
:
TypeError: object of type 'int' has no len()
I have seen other posts on here but haven't found the solution yet.
I'm confused. Please comment if you know what's going on here.
Here's my code:
#ch6.ex11.pydef squareEach(x):sqrt = x*xreturn sqrtdef main():n = []n = eval(input("Enter a list of numbers to be squared seperated by comma:\n"))i = 1sqrtn = ()for i in range(len(n)):sqrtn = squareEach(n)++iprint("Here's your results: ",sqrtn)main()