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
Alexxandr [17]
4 years ago
10

Write a short program using a while loop which will display all of the even numbers starting with 12 and ending with 86. (test y

our program in pycharm)
Computers and Technology
1 answer:
BARSIC [14]4 years ago
5 0
Lua

for i =12,86,2 do

print (i)
end
You might be interested in
How is energy expended in active transport​
professor190 [17]

Here's the biology explanation:

Most of the energy expended by a cell in active transport is used to pump ions out of the cell across the plasma membrane.

7 0
4 years ago
My friend Leo wants to have an emergency plan for his final exams on University of Southern Algorithmville. He has N subjects to
leonid [27]

Answer:

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following property: At every step, we can make a choice that looks best at the moment, and we get the optimal solution of the complete problem.

If a Greedy Algorithm can solve a problem, then it generally becomes the best method to solve that problem as the Greedy algorithms are in general more efficient than other techniques like Dynamic Programming. But Greedy algorithms cannot always be applied. For example, the Fractional Knapsack problem (See this) can be solved using Greedy, but 0-1 Knapsack cannot be solved using Greedy.

The following are some standard algorithms that are Greedy algorithms.

1) Kruskal’s Minimum Spanning Tree (MST): In Kruskal’s algorithm, we create an MST by picking edges one by one. The Greedy Choice is to pick the smallest weight edge that doesn’t cause a cycle in the MST constructed so far.

2) Prim’s Minimum Spanning Tree: In Prim’s algorithm also, we create an MST by picking edges one by one. We maintain two sets: a set of the vertices already included in MST and the set of the vertices not yet included. The Greedy Choice is to pick the smallest weight edge that connects the two sets.

3) Dijkstra’s Shortest Path: Dijkstra’s algorithm is very similar to Prim’s algorithm. The shortest-path tree is built up, edge by edge. We maintain two sets: a set of the vertices already included in the tree and the set of the vertices not yet included. The Greedy Choice is to pick the edge that connects the two sets and is on the smallest weight path from source to the set that contains not yet included vertices.

4) Huffman Coding: Huffman Coding is a loss-less compression technique. It assigns variable-length bit codes to different characters. The Greedy Choice is to assign the least bit length code to the most frequent character. The greedy algorithms are sometimes also used to get an approximation for Hard optimization problems. For example, the Traveling Salesman Problem is an NP-Hard problem. A Greedy choice for this problem is to pick the nearest unvisited city from the current city at every step. These solutions don’t always produce the best optimal solution but can be used to get an approximately optimal solution.

6 0
3 years ago
How do i clear my search history ?
nydimaria [60]
If an iphone go to the open book icon then go to history and clear from there if on a laptop go to the top right and look at the three ... press it and go to history and press clear history I don’t remember about android
4 0
3 years ago
Read 2 more answers
Which type of document should Omar print?
Zinaida [17]

Well it depends on the topic he is doing. if it is a list then a plain doc with a list of numbers. if he is writing a letter then he should use the letter template.

7 0
3 years ago
Read 2 more answers
The statements in the body of a while loop may never be executed, whereas the statements in the body of a do-while loop will be
LenKa [72]

Answer:

a. at least once

Explanation:

A loop is a code snippet that uses a condition to run repeatedly for multiple times which could be zero, one or more times. As long as the condition is true, the loop statement executes over and over again. Three common types of loop are;

i. for loop

ii. while loop

iii. do while loop

In a for or while loop, the condition for the loop is first tested before the statements in the loop are executed. Statements in the body of the loop are executed zero or more times. i.e the loop statement (statement in the body of the loop) may or may not be executed.

In a do..while loop, the statements in the loop are executed first before the condition of the loop is tested. In this case, the statements in the body of the loop are executed one or more times. i.e the loop statement is executed at least once.

6 0
3 years ago
Other questions:
  • Which dialog box opens after selecting a cell in the list of prepared data, clicking the insert tab on ribbon and the clicking t
    6·1 answer
  • What is a expansion card for computer?
    5·1 answer
  • TP is commonly used to __________ and __________ files to a server.
    5·1 answer
  • Which of the following solutions enables simultaneous digital transmission of voice, video, data, and other network services ove
    7·1 answer
  • A binary message consisting of four bits was sent to you by a friend. The message was supposed to be ABAB. Unfortunately, your f
    8·1 answer
  • Why do filmmakers release trailers?
    5·2 answers
  • Rick is teaching a photographic worship about sun color and image. He shows the students a few images to teach them about contra
    12·1 answer
  • Harry has created a Microsoft Excel workbook that he wants only certain people to be able to open. He should use
    13·1 answer
  • Discuss the information justify with two examples<br>​
    11·1 answer
  • television broadcasts were originally delivered by using which technology? ethernet wireless coaxial cable broadband
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!