Just like @chipplayer37926 mentioned, it seems your return statement's indentation is not correct.
Try copying and pasting your code into online IDEs such as repl.it so you can fix it, test it and bring it back to Codecademy.
His code is correct, when we are talking about the use of the range function. Whenever we use range() it means we want our code to generate a list starting from 0 until N - 1 (where N is the value you passed as a parameter to the function).
You can also see the range function like this range(stop) or range(start, stop, step) (the first option is the default one, if we can say it like this) so doing range(3) or range(0,3,1) will result at the exact same thing: a list containing numbers from 0 to N - 1, in this case 0 until 2, inclusive.
The way you did wouldn't work because the value 3 is an integer and such has no len(), you can test it if you want.
If you already know the length and need to generate a list, simply use range(valueHere).
Hope my explanation was clear, if not, I'll find another way to explain!