1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
7nadin3 [17]
2 years ago
15

Write the code to produce a for loop that counts down from 20 to 0 by 2’s and prints the number each time it goes through the lo

op. (python)
Computers and Technology
1 answer:
yulyashka [42]2 years ago
3 0

Explanation:

Count-controlled for loop (Three-expression for loop)

This is by far the most common type. This statement is the one used by C. The header of this kind of for loop consists of a three-parameter loop control expression. Generally it has the form:

for (A; Z; I)

A is the initialisation part, Z determines a termination expression and I is the counting expression, where the loop variable is incremented or dcremented. An example of this kind of loop is the for-loop of the programming language C:

for (i=0; i <= n; i++)

This kind of for loop is not implemented in Python!

Numeric Ranges

This kind of for loop is a simplification of the previous kind. It's a counting or enumerating loop. Starting with a start value and counting up to an end value, like for i = 1 to 100

Python doesn't use this either.

Vectorized for loops

They behave as if all iterations are executed in parallel. This means, for example, that all expressions on the right side of assignment statements get evaluated before the assignments.

Iterator-based for loop

Finally, we come to the one used by Python. This kind of a for loop iterates over an enumeration of a set of items. It is usually characterized by the use of an implicit or explicit iterator. In each iteration step a loop variable is set to a value in a sequence or other data collection. This kind of for loop is known in most Unix and Linux shells and it is the one which is implemented in Python.

Example of a simple for loop in Python:

>>> languages = ["C", "C++", "Perl", "Python"]  

>>> for x in languages:

...     print(x)

...  

C

C++

Perl

Python

>>>

You might be interested in
Determine which program you would recommend each of the customers should use. There are multiple correct answers so please inclu
Lana71 [14]
  1. Since Adult A has been asked to create a website for their church, the most appropriate software to use is Sublime Text because it can be used to type all of the instructions to be executed.
  2. Adult B should use Adobe Photoshop to create a flyer about an upcoming social gathering for her workplace.

<h3>What is a text editor? </h3>

In Computer technology, a text editor can be defined as a tool which is typically designed and developed to enable a software or web developer in typing and create the instructions to be used in a software or website such as a blog.

Sublime Text is a very good example of a text editor and should be used by Adult A to create a website for his or her church because it can be used to type all of the instructions that need to be executed and provides indentation by default.

On the other hand (conversely), Adult B should use Adobe Photoshop to create a flyer about an upcoming social gathering for her workplace because it is arguably the best graphics design software.

Read more on text editor here: brainly.com/question/4004088

#SPJ1

5 0
1 year ago
To do a good job of searching periodicals at your library, you should use A) the Library of Congress Authorities webpage. B) web
jonny [76]

Answer:

C) the online catalog.

Explanation:

An online library catalog describes the periodicals, videotapes, and books as it is the electronic bibliographic database. This evolved from the printed source, the library card catalog. Hence, this clarifies that its C. the correct option.

However, LexisNexis is the unit that gives computer-assisted research CALR and business research as well as risk management services. So through this, you can get the legal and journalistic documents.

And the stack or the book stack which is referred to as the library building block is for book storage. And the library of Congress Subject Headings is active since 1898 and holds the catalog materials which are being collected by the Library of Congress, and they do not keep track of periodicals. And the BizMiner is for financial reports.

Hence, the correct answer is the C) the online catalog.

5 0
3 years ago
If a touch screen chrome is not charging what is wrong with it
AysviL [449]
Look it up on a best buy website ion know
5 0
3 years ago
Read 2 more answers
Complete the program segment below to write the numbers 1 through 50 to the numbers.txt file.
Ludmilka [50]

Answer:Usisksk

Explanation:

Js JSU’s

8 0
3 years ago
What kind of image does this photograph represent?
Drupady [299]
C architecture photograph
8 0
2 years ago
Read 2 more answers
Other questions:
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • The create_python_script function creates a new python script in the current working directory, adds the line of comments to it
    9·1 answer
  • Write a while loop that adds the first 100 numbers (from 1 to 100) together. To do so, use a while loop that continues while the
    12·2 answers
  • One advantage of using personal computers for Internet access is that they have relatively large screens for viewing Internet co
    7·2 answers
  • Write a Python3 program to check if 3 user entered points on the coordinate plane creates a triangle or not. Your program needs
    12·1 answer
  • PLEASE HURRY 30 POINTS
    15·2 answers
  • What is the relationship between agile teams and project requirements
    9·1 answer
  • Document accurately describes the differences between servers and computers and between local and wide area networks. Document p
    5·1 answer
  • Please answer quickly :S
    7·2 answers
  • Explain why you do not need expensive equipment to take pictures or record video?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!