Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python range() backward

# welcome to softhunt.net
# decremented by 4
print('decremented by 4: ')
for i in range(15, 2, -4):
	print(i, end=" ")
print()

# decremented by 3
print('decremented by 3: ')
for i in range(15, 2, -3):
	print(i, end=" ")
print()

# decremented by 2
print('decremented by 2: ')
for i in range(15, 2, -2):
	print(i, end=" ")
print()
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python
ADD COMMENT
Topic
Name
3+6 =