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
Legit question what is 10x 10 100 or 1000 I keep getting confused isn't it 100?
s344n2d4d5 [400]
Yea it is 100 :)

10x10=100
7 0
3 years ago
Read 2 more answers
Help please asap with this​
Allushta [10]
Use photo math app it will help you

The second one 1.7 = 17/10
-0.048 = -6/125
98% = 98/100= 49/50
5 0
3 years ago
Describe at least two differences between constructing an inscribed regular
Naddika [18.5K]

Answer:

They are very different because hexagons are amazing and squares are boring.

Step-by-step explanation:

4 0
3 years ago
Solve the inequality 2x+y &gt;1
Wittaler [7]
The answer is y>-2x+1
4 0
3 years ago
4(0.5f−0.25)=6+f what is f<br><br><br> I am so lost when we were doing this in class
muminat
4 (0.5f - 0.25) = 6 + f
2.0f - 1.0 = 6.0 + f
1.00f = 6.0 + f
f = -5.0
hope this is right,
~ Harley Quinn~
8 0
3 years ago
Read 2 more answers
Other questions:
  • 2. The amount of fertilizer in a landscaping company’s warehouse decreases at a rate of 3% per week. The amount of fertilizer in
    14·1 answer
  • What is the value of 3x3x3 +7(2x-6), when x=4
    10·1 answer
  • Applying Math<br> 8. Solve the equation to<br> show how/= becomes<br> R= Show your work.
    8·1 answer
  • The length of a rectangle is twice that of its width. If the area of the rectangle is 72 square inches, then find the length and
    12·1 answer
  • A grocery store charges $1.49 per pound of bananas. Use a unit rate to find the price of 3 pounds of bananas.
    15·1 answer
  • (-2,1); perpendicular to y= - 2/5x -4<br><br> Help explain step by step?
    15·1 answer
  • Which statement compares the two numbers correctly?
    10·1 answer
  • Each football player is recommended to drink a minimum of 540 milliliters of water for every 1 hour of play. Aaron expects to pl
    9·1 answer
  • Help help help help help help help help help help help help help help help help help help help help help help help help help hel
    15·2 answers
  • Simplify this expression √8 + 6(√32 − √18)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!