Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python (15 2) Write a while loop to add the numbers from 1 to 20. Write the sum to the screen as follows: The sum

python image text in transcribed
image text in transcribed
(15 2) Write a while loop to add the numbers from 1 to 20. Write the sum to the screen as follows: The sum of the integers 1 - 20 is: 1 + 2 + 3 ... 20 = 190 Coding Steps: 1. Create accumulators to hold sum of numbers and count for loop. count = 0# nbr of times in the loop sumTotal = 0 # total of nbrs 2. Print the header print("The sum of the integers 1-20 is:") print(" \t") # It to create a tab character 3. Code a while loop going from 1 to 20. Add to your accumulators - count and sumTotal. Finally print the value of count we are currently processing. while

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago