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
How would a die-out herbivore zooplankton impact the food web?
BaLLatris [955]

Tbh I don’t even know
5 0
3 years ago
Effects of chronic __________ use include kidney disease and dysfunction, liver disease, infections in the luA. tobacco
Natali5045456 [20]
Heroin causes liver disease and dysfunction. Infections are likely to occur but not limited to sharing needles.
5 0
3 years ago
Aside from an associates degree what else can you earn at a two year college
Ksenya-84 [330]
You can earn multiple certificates and trades such as an automotive or mechanics trade would be an example
7 0
3 years ago
Read 2 more answers
Juana has just been diagnosed with muscular dystropy what is most likely her age
wolverine [178]

Answer:

16 years because it usually occurs in younger people/teens

6 0
3 years ago
According to Brutus, no. 1, why was it so important that the question of whether to adopt the Constitution be decided correctly?
neonofarm [45]

Answer:

The public is selecting whether to approve a government that will protect their liberties or could subvert them. Ratification is the most important question because it determines the well being for the future generations

Explanation:

Hi I love u have a great day.

6 0
3 years ago
Other questions:
  • Vitamins are macronutrients.<br> (T/F)
    11·2 answers
  • Earth scientists often use ______ to represent complex objects or processes.
    5·2 answers
  • A red light flashes every 32 minutes. A blue light flashes every 24 minutes. when will the two lights flash together again if th
    8·1 answer
  • Ways to improve positive attitude
    9·2 answers
  • How are periods<br> and groups<br> different from<br> each other on the periodic table
    12·1 answer
  • Pananaw ng mga magulang/nakakatanda​
    13·1 answer
  • Anton needs to identify the eight different scoring statistics for all the players on his school’s basketball team. Which graphi
    8·2 answers
  • Hey, Guys! I made it into AP Lang but this assignment is tough and it's due TOMORROW. I would appreciate any help you can give!
    8·2 answers
  • A scientist plants two rows of corn for experimentation. She puts fertilizer on row 1 but does not put fertilizer on row 2. Both
    11·1 answer
  • Explain what reserved and concurrent powers are and give examples of each
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!