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
horsena [70]
3 years ago
8

It is good programming style to always use a for loop when the number of times to repeat the action is known. The following code

uses a while loop that mimics what a for loop should do. Rewrite it using a for loop that accomplishes exactly the same thing.
myprod = 1;
i = 1;
while i <= 4
num = input('Enter a number: ');
myprod = myprod ⁎ num;
i = i + 1;
end
Mathematics
1 answer:
Paraphin [41]3 years ago
7 0

myprod = 1

num = input("Enter a number: ")

for i in range(1, 5):

myprod *= num

You might be interested in
6248 divided by 38<br> Quotient:<br> Remainder:
AlekseyPX
Quotient: 164
Remainder: 8/19
5 0
4 years ago
Pls answer quick thank you soooooooo much
Tju [1.3M]

Answer:

4

Step-by-step explanation:

<u>Step 1:  Find the constant </u>

A constant is a number in a function that never changes.  In this example:  2x^2 + 4x + 7, the constant is 7.

Therefore, the constant in 6x^3y + 7x^2 + 5x + 4

The answer is 4 beause it never changes.

Answer:  4

3 0
4 years ago
Someone pls help with number 4, giving brainlyist
Darya [45]

Answer:

idk sorry don't report please if your nice

6 0
3 years ago
Read 2 more answers
Find the slope of the following graph.
RoseWind [281]

Answer:

use the formula :

m = (y2 - y1) / (x2 - x1)

m = (2 - 0) / (3 - 0)

m = 2 / 3

A

6 0
3 years ago
Sarah wants to join a gym. Fitness Gym charges a $120 enrollment fee and $25 a month. Sports Gym charges no enrollment fee and $
kirill [66]

Answer:

it will take about 6 months

4 0
3 years ago
Read 2 more answers
Other questions:
  • Starting at home, Michael traveled uphill to the gift store for 24 minutes at just 10 mph. He then traveled back home along the
    9·1 answer
  • PLEASE ANSWER!!!! simplify the expression so there is only one power for each base.
    11·1 answer
  • PQRS is a quadrilateral. &lt;PQR = (7x-2) PSR = (5x+14) what is the measure of angles PQR and PSR?
    15·1 answer
  • URGENT! (Grades close tomorrow and turning this in will boost my grade from a B to an A in College Algebra. I can't figure these
    7·1 answer
  • What is the outlier in the following set? 29, 2, 28, 30, 26, 31
    13·2 answers
  • What is the slope of this line?​
    10·1 answer
  • (7th grade work) How many gallons of water were in the bucket after 1 second? Explain your thinking.
    7·1 answer
  • What is the slope of this line?
    8·2 answers
  • Carrie wants to cut out fabric in the shape of a letter "C" to sew onto the back of a shirt. She sketched out her pattern on gra
    11·1 answer
  • 5 pts<br> Question 17<br> Subtract -9.3 - (-2.09)<br> -8.79<br> -7.39<br> 11.39<br> -7.21
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!