Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Print numbers with steps

Instructions

Given positive integer n and integer step implement a function which returns an array representing all numbers from n to 1 taking step into consideration. If n value is zero then empty list should be returned.

Challenge | Solution

Examples

print_numbers_with_step(0, 1) # []

print_numbers_with_step(6, 1) # [6, 5, 4, 3, 2, 1]

print_numbers_with_step(6, 2) # [6, 4, 2]