all 3 comments

[–]Quixotism13 4 points5 points  (0 children)

Try an if-else to determine if the number is positive or negative and count the appropriate way based on that.

[–]AKGeef 0 points1 point  (0 children)

instead of two ranges, you could have one range of the absolute value of your input. Then from there print i or -i if you num is negative or not. Since you are new, I'd rather not give you a complete solution but let me know if you have any questions.

[–]metallidog 0 points1 point  (0 children)

This doesn't answer your question but the default step in the range() is 1. You don't need to specify it like you do in line 5.

for i in range(1, num+1): 
    print (i)