Question: Task 1: Use of range() In a separate file, write a short program that uses a for loop to output every third number starting at

Task 1: Use of range()

In a separate file, write a short program that uses a for loop to output every third number starting at 11 for 5 iterations. Print the numbers on a single line.

Use comments to explain your choices for values in the range() function call.

Task 2: Accumulator Pattern

In a separate file, write a short program that sums the numbers 1 through 5 and prints the sum.

Task 3: Interactive Loop

In a separate file, write a program that sums numbers obtained from the user. Numbers in the range of -100 to 100 are valid. A number outside this range indicates that the user is finished with their input.

Print the sum of the numbers when complete.

Task 4: Post-Test Loop

Use the post-test loop pattern to implement user input validation. Ask the user for a number between 1 and 7. Repeat the input request if the number entered is outside the range.

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 Programming Questions!