I think it should be square brackets after values, like this:
values = [x * 2 for x in range(1000)]
Also noticed that there may be two spaces values = in your code, not sure if that causes any problem.
I reproduced your code, and looks like nothing wrong. Maybe just remove that extra white-space after values =, and then make sure it’s all saved before you run it, otherwise it may run an older version of your code.