I want to code a function and get expected results like this (when i input number = 10):
10
9
8
7
6
5
4
3
2
1
And when i input number = -10 :
-10
-9
-8
-7
-6
-5
-4
-3
-2
-1
This is my code. Only works when number = 10. No result when im trying to input a = -10:
def function_while(number):
i=0
while i<number:
if True:
print(number-i)
else:
print(number+1)
i+=1
function_while(number)
Is there any solution?