I\'m getting this strange error trying to run a script, the code appears to be correct but it seems python (3) didn\'t liked this part:
def function(
This is because Python 3 range
does not return a list
, unlike Python 2. This code was written for Python 2.
This code should be changed:
range(-30,0) + range(1,30)
It should be changed to:
[*range(-30,0), *range(1,30)]
Prior to Python 3.5 (2015, PEP 448 - Additional Unpacking Generalizations), you cannot use *
inside lists, and must write it this way instead (or you may prefer this):
list(range(-30,0)) + list(range(1,30))