If you want your code to print the output from the function call, you'll have to change the last line with this:
print(number_range(2,8))
Also, your function's output for that input will be [3, 4, 5, 6, 7, 8]. As they've told you, the way you used range() is not common at all and could be changed by the standard (first, last+1).
If you REALLY want to use range() that way, which is basically a range() with a single parameter, you'd have to do it like this, substracting 1:
def number_range(num1,num2):
list1=[]
for i in range(num2-num1-1):
num1 = num1+1
list1.append(num1)
return list1
print(number_range(2,8))
[3, 4, 5, 6, 7]
In any case, while I was writing this answer Shazers provided an implementation using standard syntax, and I highly recommend his solution over mine. Use this one only if you were using range() with a substraction for a certain reason you didn't comment on.