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]
3 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]3 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
Consider the security of a mobile device you use
Alekssandra [29.7K]

Answer:

keep it private

Explanation:

7 0
3 years ago
Are all the computer users known as programmer ​
Evgesh-ka [11]

Answer:

Nope

Explanation:

programmers are diff

6 0
3 years ago
3. Radheshree has to complete her assignment and submit it on the next day. While typing
Dafna1 [17]

Answer:

she can use the onscreen keyboard

this application is present in accessories file in the windows

5 0
3 years ago
If you have a database with birthdates, and you would like to find everyone who was born before June 16, 1967, what would you en
Tcecarenko [31]

Answer:

<June 16,1967

Explanation:

7 0
3 years ago
Read 2 more answers
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Xelga [282]

Put a code or security system on or a very secure password

Hope this helps...

6 0
3 years ago
Read 2 more answers
Other questions:
  • Local television news networks cover only
    8·2 answers
  • Which of the following is the best example of a manager with a delegator leadership style
    10·2 answers
  • A(n) ________ converts your voice's sound waves into digital signals.
    9·1 answer
  • John was carrying on at the water cooler the other day, trying to show off his knowledge of networking. He claimed that the comp
    10·1 answer
  • Service that connects on-premises software appliances with cloud based storage is ______
    10·1 answer
  • Complete this assignment in Python 3.x. Make sure you have downloaded the software, and it is installed correctly.
    10·1 answer
  • Rain forests clean the air by producing oxygen. Some rain forest plants have healing properties, and can be used as medicine. Ra
    12·1 answer
  • Where do charts get the data series names?
    14·1 answer
  • What do you hope that people see in your digital footprint 5 years from now? ​
    5·1 answer
  • Please please help I don’t understand
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!