Question: Python Use a for loop to make a counter that counts up to, and including 20. (Google counter Python.) Print every iteration of the loop.

Python

Python Use a for loop to make a counter that counts up

Use a for loop to make a counter that counts up to, and including 20. (Google "counter Python".) Print every iteration of the loop. After the loop is completed, print the sentence "The counter counted up to 20" (where 20 is a variable). Print the sum of all numbers counted, give the result in a sentence. Print both variables (the counter value and the sum) in one string. This can be done using something called "string formatting

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!