jasminsanchez jasminsanchez
  • 16-11-2017
  • Computers and Technology
contestada

Write a program that prints the number 1 through 10 using a while loop

Respuesta :

Zepdrix
Zepdrix Zepdrix
  • 17-11-2017
Which programming language are you working in?

Here is how you could achieve this in Python:

establish a counter, starting at 1.
While your counter is 10 or less, do two things:
print the counter,
and increase the counter by 1.

code:
counter = 1

while counter <= 10:
print(counter)
counter = counter + 1

Those last two lines should be indented.
Answer Link

Otras preguntas

Why were Bostonians angry with British troops in their town
Country A has a growth rate of 2.2% per year. The population is currently 5,667,000, and the land area of Country A is 31,000,000,000 square yards. Assuming thi
How many grams of FeCl 3 are in 250. mL of a 0.100 M solution?O A. 64.9 gOB. 4.06 gAI O C 0.0250 gD. 25.0 gHATHiiHii​
y=4 when x=9 Work out the value of y when x=25
What do you mean by rule of law?
Write the equation 5x+10y=20 in slope-intercept form. Then graph the line described by the equation.
Sorry i know it is too blurry but can u at least tryDon’t answer if u think I’m letting everyone else do my work BECAUSE I DO OTHERS TOO but i don’t understand
What type of galaxy consists of nebulas therefore has younger stars?
Denis, Vera, and Yash are rock climbers. Yash is connected to Vera by a 30 m rope, which is taut, and Vera is connected to Denis by a 25 m rope, which is also
0.08 0.52 I need more help