<- Back to the chapter.

Answer to Problem 5

Question:

Use two for, one of them nested, to print the following 20x5 rectangle:


Again, like Problem 3 and Problem 4, but with different range values.

Answer:

for i in range(5):
    for j in range(20):
        print("*", end=" ")
    print()
Output:
* * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * *