Question: Write a program to display a value starting at 1 which has been incremented a specified number of times. Ask the user how many numbers
Write a program to display a value starting at which has been incremented a specified number of times.
Ask the user how many numbers they would like displayed. Validate the input and if they have entered a positive non zero integer then ask the user what the increment value should be Validate the input and if they have entered a positive non zero integer for the increment value then display that many numbers starting from The counter and value both start at
If they did not enter positive non zero integers for either of the values, inform them as per the examples below.
Hints.
Ensure you handle any spaces entered as part of the input.
Notice how you can't increment in steps of
Notice that 'Bye. is displayed only if the values were able to be displayed.
The solution is between making use of enumerate and lines of code.
The solution does not use a nested loop.
Not all the test data used is shown.
For example:
Input Result
two
Please enter how many numbers you would like displayed:
Please enter the increment value: two
Positive non zero integers only.
ten
Please enter how many numbers you would like displayed: ten
Positive non zero integers only.
Please enter how many numbers you would like displayed:
Please enter the increment value:
The increment value needs to be
Please enter how many numbers you would like displayed:
Please enter the increment value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Bye.
Please enter how many numbers you would like displayed:
Please enter the increment value:
Positive non zero integers only.
Please enter how many numbers you would like displayed:
Please enter the increment value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Counter: value:
Bye.
Please enter how many numbers you would like displayed:
There is nothing to count.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
