<- Back to the chapter.

Answer to Problem 2

Problem

Write code that will print the following:

* * * * * * * * * *
* * * * *
* * * * * * * * * * * * * * * * * * * *

Answer:

for row in range(10):
    print("*",end=" ")
print()
for row in range(5):
    print("*",end=" ")
print()
for row in range(20):
    print("*",end=" ")
Output:
* * * * * * * * * *
* * * * *
* * * * * * * * * * * * * * * * * * * *

Explanation: