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
Given the expression below, what are the missing values, respectively?
asambeis [7]

Answer:

F.

Step-by-step explanation:

20=4*5

9=4+5

7 0
3 years ago
Two trains leave stations 272 miles apart at the same time. One train travles 75 miles per hour while the other travles at 95 mi
VARVARA [1.3K]
102 miles for them to meet up

5 0
3 years ago
Mr. Brady is using a coordinate plane to design a treasure hunt for his students. The hunt begins at the flagpole. The first clu
dmitriy555 [2]

Answer:

The figure is attached and the total distance is 1031 feet.

Step-by-step explanation:

The graph is indicated in the attached figure.

For calculation of distance consider following

Point Flagpole is (0,0)

Point Clue1 is (0,5)

Point Clue2 is (6,0)

Point Clue3 is (0,-5)

So the distance is calculated as follows

d_{T}=[d_{FP\ to\ Clue1}+d_{Clue1\ to\ Clue2}+d_{Clue2\ to\ Clue3}]*distance\ per\ unit\\d_{T}=[\sqrt{(Clue1_x-FP_x)^2+(Clue1_y-FP_y)^2}+\sqrt{(Clue2_x-Clue1_x)^2+(Clue2_y-Clue1_y)^2}+\sqrt{(Clue3_x-Clue2_x)^2+(Clue3_y-Clue2_y)^2}]**distance\ per\ unit\\Substituting the values

d_{T}=[\sqrt{(0-0)^2+(5-0)^2}+\sqrt{(6-0)^2+(0-5)^2}+\sqrt{(0-6)^2+(-5-0)^2}]*50 \text{ feet}\\d_{T}=[\sqrt{(0)^2+(5)^2}+\sqrt{(6)^2+(-5)^2}+\sqrt{(-6)^2+(-5)^2}]*50 \text{ feet}\\d_{T}=[\sqrt{0+25}+\sqrt{36+25}+\sqrt{36+25}]*50 \text{ feet}\\d_{T}=[\sqrt{25}+\sqrt{61}+\sqrt{61}]*50 \text{ feet}\\d_{T}=[5+7.81+7.81]*50 \text{ feet}\\d_{T}=[20.62]*50 \text{ feet}\\d_{T}=1031 \text{ feet}\\

So the total distance travelled is 1031 feet.

4 0
3 years ago
Help me out with the answer!!!!!!
Pie

Answer:

Adjacent

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
Is this right?<br> I’m not sure in my answer
gayaneshka [121]

Answer:

Yeah that seems good. ghg

5 0
3 years ago
Other questions:
  • Giving brainlist so plzzz help i really need help and im stuck
    9·2 answers
  • What is 0.44 written as a fraction in simplest form
    5·2 answers
  • EUR
    13·1 answer
  • What is the slope and y intercept of (-3,0),(2,-3)?
    8·1 answer
  • Substitute 3y+2 for x in the second equation 2(3y+2)-5y=2
    11·1 answer
  • A driver is 40 yards long. About how many meters long is it?
    15·2 answers
  • Jacob went on a fishing trip. This year he caught 30 fish, which is six more than twice the number he caught last year. How many
    15·1 answer
  • 3. Triangle ABC has angle measures as noted below. Please note this triangle is not drawn to scale, and the longest leg of the f
    5·1 answer
  • Look at the picture........... need it done ASAP
    13·1 answer
  • Diana has 18 apples more than Roberto. Together, Diana and Roberto's apples are 48. How many apples does each have?​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!