I'm a student that recently began to study Python, i was wondering how could I write a code that when you write a number the program writes all the numbers till 1 in order, ex: input=5 and it has to print 4,3,2,1.... The problem is when it comes to a negative number because i can write a code for those and it could be like:
num=int(input("Insert Input"))
while num > 0:
print(num)
num=num-1
Does anyone know how could I use the break command in order to stop negative numbers for writing them till 1? Ex. input=-9 -9,-8,-7.....1 Obviously it will be necessary to insert an if condition to verify if the entered number is negative or positive. The code has to be as easy as possible cause i didn't do a lot of functions and i want to learn on my own some loops. Ty :)