Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started