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
ad-work [718]
3 years ago
13

Write code which prints every number from 1 to 20 a number of times equal to the number itself (e.G. One 1, two 2's...). Every i

ndividual number printed should be separated by a space, and there should be a new line each time the number changes. You should use nested loops to produce your output (it will result in far less code).
Advanced Placement (AP)
1 answer:
madreJ [45]3 years ago
8 0

Answer:

Answered in Python

for i in range(21):

    for j in range(i):

         print(i, end=' ')

    print(" ")

Explanation:

This iteration iterates from 1 to 20

for i in range(21):

This iteration iterates from 1 to current number

   for j in range(i):

This prints the current number in the a number of times equal to itself

       print(i, end=' ')

This enables printing on new line

   print(" ")

You might be interested in
What is the enrollment period for a 529 college savings plan
blagie [28]

Answer:

year round

Explanation:

7 0
3 years ago
Read 2 more answers
The fourteenth amendment essentially overturned the?
Troyanec [42]

Answer:

Dred Scott decision

Explanation:

The fourteenth amendment overturned the Dred Scott decision by granting citizenship to all individuals born in the United States.

3 0
2 years ago
What is a good summary fr a sorry msg to a bird for tranquilizing it on April fools daw JK a sew whatever the heck u want to
docker41 [41]
Lol. Here I am.. Saying whatever the heck I want. :)
5 0
3 years ago
Read 2 more answers
Who can help me with this?
Nina [5.8K]
I don’t know if it’s glitching for me, but I can not see the picture
5 0
3 years ago
Read 2 more answers
7. A misfiring spark plug can cause a false oxygen sensor reading.
Korolek [52]
What’s the question
4 0
3 years ago
Other questions:
  • Shutter speed affects how much light enters the camera and aperture affects how long the light enters the camera.
    10·2 answers
  • Which of the following is true? aDebit cards offer the highest level of fraud protection.
    15·1 answer
  • What’s an example of inattentional blindness?
    14·1 answer
  • Which strategies should you follow if you begin to feel fatigued while driving
    8·1 answer
  • Which of the following is NOT one of the methods Krakauer used to research his subject?
    12·1 answer
  • the habit of thinking of a people is an essential part of their culture. How does this observation explain the relationship betw
    7·1 answer
  • An astronaut floating in space throws a rock. What will happen to the rock
    10·2 answers
  • If you have adjusted your privacy settings, you can be certain that no one else will see your photographs online.
    7·2 answers
  • HELP TIMED QUESTION 30 POINTS
    6·1 answer
  • According to Diamond, livestock also plays a significant role in a civilization's ability to become rich and powerful. How did t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!