The function below takes two integer parameters: low and high. Complete the function so that it prints the numbers from low to high in order, including both low and high, each on a separate line. The recommended approach for this question is to use a for loop over a range statement.


1 def print_range(low, high):

2 # Implement your function here. Be sure to indent your code block!

Respuesta :

ijeggs

Answer:

def print_range(low, high):

 for i in range(low,high):

   print(i)

Explanation:

Create the function to accept two parameters (low and high)

Use a for loop to iterate from low to high using the range function

Print the value at each iteration

See a complete program and output below.

def print_range(low, high):

 for i in range(low,high):

   print(i)

low = 1

high =10

print_range(low, (high+1))

Ver imagen ijeggs