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
do you ever feel that you want to be someone else like me i want to be Gar/Beast Boy and i wish i had a girl like Rachel
otez555 [7]

Answer:

Sometimes

Explanation:

7 0
3 years ago
Explain how and why states in Africa developed and changed over time
OLEGan [10]

Answer:

they wanted independence from france

Explanation:

3 0
3 years ago
Match each word or phrase to its correct definition.
quester [9]

Answer:

N/A

Explanation:

PLEASE AFTER THIS ANSWER MAKE QUESTION MORE CORRECT.

5 0
3 years ago
Read 2 more answers
What will be impact of an income tax increase on an economy's consumption spending, real output, and unemployment in the short r
Mademuasel [1]

Consumption will decrease, real output will decrease, and unemployment will increase.

5 0
2 years ago
Why is biomass energy not always sustainable?
PolarNik [594]

Answer:

Biomass energy usually provides an irreversible mitigation effect by reducing carbon dioxide at source, but it may emit more carbon per unit of energy than fossil fuels unless biomass fuels are produced in a sustainable manner.

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Describe why bacteria that live within the root nodules of a soy bean plant are a critical part of the nitrogen cycle please
    12·1 answer
  • What were the primary purpose of state militias?
    6·2 answers
  • Realistic conflict theory says: a. The fewer resources available, the more prejudice there will be. b. The fewer resources avail
    7·1 answer
  • Which term describes both collagen and hemoglobin
    8·1 answer
  • I have to find the y so what is 5x-8
    6·1 answer
  • Which type of fossil is formed when silica is added??
    10·1 answer
  • Which of the following refer to just noticeable difference between two stimuli
    11·1 answer
  • How do genetics (genetic predisposition) and the environment work together to cause substance abuse in individuals? What is the
    8·1 answer
  • In the context of the passage, "coarse" (sentence 1) is best interpreted as
    15·1 answer
  • What happened in the Scopes Monkey Trial?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!