Question: Given three numbers startNum , endNum , and stepSize and a Boolean includeEnd , write a function that does the following: If includeEnd is False

Given three numbers startNum, endNum, and stepSize and a Boolean includeEnd, write a function that does the following:

  • If includeEnd is False, print the whole numbers starting from startNum up to but not including endNum, increasing by stepSize for each number.
  • If includeEnd is True, do the same thing but include endNum when printing the number range.
  • Each number should be printed on a separate line.

Use the following function definition:

def printNumbers(startNum, endNum, stepSize, includeEnd):

Hint: There are situations where endNum wont print even if includeEnd is True.

For example, given startNum = 10, endNum = 13, stepSize = 1, and includeEnd = True, your function should print the following:

10

11

12

13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!