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
To use patterns and observations to say what happens next
posledela
You would need to show a pic
4 0
3 years ago
Open source companies like Ethereum and Codius are enabling Smart Contracts using blockchain technology.
Olin [163]

Answer:

True

Explanation:

Ethereum uses Smart Contracts Blockchains and one of the programmers actually explained how it works at a DC Blockchain Summit.

3 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly. Code in which server-side language can be embedded into an HTML d
Zarrin [17]

Answer:

What does the letter T in SMART goal represent? The letter T in SMART goal stands for .

Explanation:

Type the correct answer in the box. Spell all words correctly. What does the letter T in SMART goal represent? The letter T in SMART goal stands for .

A:

The correct answer would be, Time based goals.The letter T in SMART goal represents Time based Goals.Explanation:SMART goals is an approach in Business Administration. It is basic…

6 0
2 years ago
Read 2 more answers
What how do i delete a question
Dvinal [7]

Answer: not sure if you can

Explanation: idk if you can but if you wanna get a good answer try searching up on google hope i helped!

7 0
2 years ago
Suppose a program takes 1000 machine instructions to run from start to end, and can do that in 10 microseconds when no page faul
Tema [17]

Answer:

(10^6 + 9.9)

Explanation:

Given:

Total number of machine instructions = 1000

Number of page fault in 100 instructions = 1

Number of page faults in 1000 instructions = 10

Time to serve one page fault = 100 milliseconds

Time to serve ten page faults = 100*10 milliseconds = 1000 milliseconds = 10^6 Microseconds

Number of instructions without any page fault = 1000 - 10 = 990

Time required to run 1000 instructions = 10 Microseconds

So, time required to run 990 instructions = (10*(990/1000)) Microseconds = 9.9 Microseconds

So, the total time required to run the program = (10^6 + 9.9) Microseconds

3 0
3 years ago
Other questions:
  • Theâ ______ is a large worldwide collection of networks that use a common protocol to communicate with one another.
    5·1 answer
  • What is the "host" in a typical email address?
    14·1 answer
  • When presentations are being shown to an audience of over fifty people, how they should be displayed?
    5·2 answers
  • A must decode this code. I guess is not a Cesar. The last line is a email adress.
    15·1 answer
  • While using the CLI on a Windows 10 64-bit computer with a single HDD and a single volume, you want to move from the current dir
    15·1 answer
  • What happens when you press the Enter key at the end of a line of bulleted text?
    14·2 answers
  • To add a slide using the default layout, what should you do before clicking the New Slide button?
    15·1 answer
  • Which tab is used to insert a hyperlink onto a slide?
    9·1 answer
  • What do you understand by Multiprotocol Label Switching, how it works and is helpful in today's network scenario.
    15·1 answer
  • Can i have help for a ggogle class room
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!