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
If you want to distribute a formatted Microsoft word document to people who don't have word save it as a __file
Helga [31]
If you want them only to read it and not change it send as a .pdf else I would send as a .txt file. Hope that helps
5 0
3 years ago
May indicate elevation
Anton [14]
Indicate Elevation means that there might be an administrator lock/login needed to download that file.
3 0
3 years ago
Read 2 more answers
Why wont my account update from Expert to Ace? I have all the points and branliests to be Ace but it wont update
grin007 [14]

Answer:

Maybe you don't have all the points and brainliests needed. Double check and if you actually don't, try to reload your device. If it still isn't working, there is something wrong with your device.

Explanation:

PLEASE MARK ME AS BRAINLIEST I REALLY WANT TO LEVEL UP

8 0
2 years ago
Read 2 more answers
You are considering upgrading memory on a laptop. What are three attributes of currently installed memory that HWiNFO can give t
Dennis_Churaev [7]

Answer:

Some of the qualities of the installed memory which HWiNFO can reveal are:

  • Date of manufacture
  • Memory type
  • Speed of memory

Explanation:

HWiNFO is an open-source systems information app/tool which Windows users can utilize as they best wish. It helps to detect information about the make-up of computers especially hardware.

If you used HWiNFO to diagnose the memory, the following information will be called up:

  • the total size of the memory and its current performance settings
  • the size of each module, its manufacturer, and model
  • Date of manufacture
  • Memory type
  • Speed of memory
  • supported burst lengths and module timings,
  • write recovery time etc.

Cheers

6 0
3 years ago
Use the drop-down menus to complete the statements about integrating pictures and text in a Word document.
FrozenT [24]

Answer:

1. Move with text

2. Fix position on page

3. Remove background

Explanation:

EDGE 2021

7 0
3 years ago
Read 2 more answers
Other questions:
  • A company decides to create static design diagrams for an upcoming project. Which statement correctly describes the attribute of
    6·1 answer
  • Transmits data as pulses of light through tiny tubes of glass Uses standard telephone lines to create a high-speed connection Co
    5·1 answer
  • i set up an account and paid the yearly fee, now it's asking me to join. i've tried to log in and brainly isn't accepting my ema
    8·1 answer
  • Why is 0.3333333333333333 the output of print(1/6 + 1/6) in python?
    8·1 answer
  • Mississippi law codes state that bullying and cyberbullying are against the law. A court can decide to incur ___________________
    10·1 answer
  • Write a program that repeatedly reads in integers until a negative integer is read. The program keeps track of the largest integ
    9·1 answer
  • Claire wants to use a conditional statement in JavaScript that provides a block of statement to be executed if the condition is
    7·2 answers
  • Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input
    5·1 answer
  • if a hacker wants to exploit the TCP three-way handshake, what is the most effective way to go about it?
    15·1 answer
  • If you added the formula =SUM(B1:B5) to a spreadsheet, what would it do?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!