On 28/04/2016 10:34, g.v.aar...@skct.edu.in wrote:
start_list = [5, 3, 1, 2, 4]
square_list = []

# Your code here!
for square_list in start_list:
   x = pow(start_list, 2)
   square_list.append(x)
   square_list.sort()
print square_list

TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int'
Please provide me the solution for the above problem

Try:

start_list = [5, 3, 1, 2, 4]
square_list = []

# Your code here!
for i in start_list:
   x = pow(i, 2)
   square_list.append(x)
square_list.sort()
print (square_list)



--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to