Mar-22-2019, 01:29 PM
(Mar-22-2019, 12:54 PM)mcgrim Wrote: yes,don't you see that L3 is list of lists (i.e. there is actually just one element)
[[1, 2, 1, 2, 1, 2]]
I am still unsure on why you asked me that.
So, it the list comprehension value of k is
[1, 2, 1, 2, 1, 2]
and you cannot raise a list to power 2
L=[1,2] L3=[3*L] print(L3) for k in L3: print(k) print(k ** 2)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs