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
Bakit Mahalagang Pag-aralan Ang heograpiyang pantao?​
scoray [572]
Mahalagang Pag Aralan ang Heograpiyang Pantao Upang malaman natin ang Wika , Relihiyon , Lahi At Pangkat Etniko.sa ibat-ibang Bahagi ng Daigdig


Upang malaman natin ang iba pang wika, relihiyon, pangkat-etniko at ibat ibang lahi sa mundo at para mapanatili na rin ang pagkakaisa at pagkakaroon ng paggalang sa iba pang mga tradisyon at kultura na mayroon ang iba.



5 0
3 years ago
If you travel for a 3.5 hours at a speed of 65 mph how far will you go
erica [24]
Think about it. 65 mph means you go 65 miles in one hour, so in 2 hours you go 65×2 miles, in 3 hours you go 65×3 miles, and in 3.5 hours you go 65 × 3.5 miles.

Hope this helped
4 0
2 years ago
The Washington state native has lived in Mississippi for thirty years; ____, she always feels betrayed by the stifling summer he
SVEN [57.7K]
B. consequently. that's the answer.
8 0
3 years ago
Read 2 more answers
A person may have two conflicting attitudes.
Rzqust [24]

Answer:

the answer it true.

Explanation:

8 0
3 years ago
Read 2 more answers
What would you predict to be the most likely most likely long term effect on an organism with damaged mitochondria
Scilla [17]
Weight gain (slower metabolism)
8 0
3 years ago
Other questions:
  • The socially determined behaviors expected of a person performing a role are called role performances.
    15·1 answer
  • AP Microeconomics, Topic: Changes In Factor Demand and Factor Supply
    7·1 answer
  • Fame is ____; today's rising star is all too soon tomorrow's washed-up has-been.
    11·2 answers
  • A conical water tank is 24 ft high and has a radius of 10 ft at the top. If water flows into the tank at a rate of 20 cubic feet
    8·1 answer
  • The Spirit of the Laws. When did he write this and why? What was his purpose? What was happening at the time that can provide in
    5·1 answer
  • Tyrick prefers to study with large groups of students and is mainly motivated by external factors, such as a big paycheck. He lo
    12·2 answers
  • Which of these is an example of a plateau.
    13·2 answers
  • POINTS FREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
    11·2 answers
  • Kendle wants to play several games of laser tag. She has $35, 5 to play g games. Each game of laser tag costs $5
    12·2 answers
  • For time t≥0 , the acceleration of an object moving in a straight line is given by a(t)=sin(t23). what is the net change in velo
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!