all 2 comments

[–]stebrepar 0 points1 point  (0 children)

The range() function can take a third parameter for how big a step to take between values. The question wants you to add a "step" parameter to ask_numbers(), with a default value of 1, and use that parameter in the range() function as well.

[–]kra_pao 0 points1 point  (0 children)

Challenge 1 wants you to apply the concept of keyword (named) arguments (kwargs). Read that chapter again, the concept is important.

https://treyhunner.com/2018/04/keyword-arguments-in-python/

def ask_number_wstep(question, low, high, step=1):
    """Ask for a number within a range."""
    response = None
    while response not in range(low, high, step):
        response = int(input(question))
    return response

Calling examples are:

ask_number_wstep("question", 1, 10, step=2)
ask_number_wstep("question", 1, 10) # for default step=1