Here's a classic nested loop example. A multiplication table:
for i in range(1, 6):
for j in range(1, 6):
print(f"{i*j:3}", end=" ")
print() # New line after each row
Output:
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
The inner loop prints one row. print() at the end moves to the next line. The :3 format specifier pads numbers to characters for alignment.