I’m starting my python journey and I’ve came across this nested loop.
I’m unable to understand the logic of this plus I can’t really understand why do we need the last print() statement at the very end.
rows = int(input("How many rows?: "))
columns = int(input("How many columns?: "))
symbol = input("Enter a symbol to use: ")
for i in range(rows):
for j in range(columns):
print(symbol, end="")
print()
New contributor
M1NT is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.