# the answer key
for num in range(-10, 0, 1):
print(num)
I wanted to see if I could find a way to do it without using range():
i = -1
while abs(i) <= 10:
print(i)
I'm new to python.
Thank you.
# the answer key
for num in range(-10, 0, 1):
print(num)
I wanted to see if I could find a way to do it without using range():
i = -1
while abs(i) <= 10:
print(i)
I'm new to python.
Thank you.
You mean this? It will mimic the range version you have in the question. Printing from -10 to -1 in increments of 1
i = -10
while i < 0:
print(i)
i += 1