Oct-17-2021, 04:23 AM
Hi everyone, i just started learning python so this might sound like a very stupid question.
So i'm doing this exercise about nested loop and i came across a line of code which i don't understand it's purpose.
What i don't understand is why ( end="" ) will actually make this loop work by show
Thank you!
So i'm doing this exercise about nested loop and i came across a line of code which i don't understand it's purpose.
What i don't understand is why ( end="" ) will actually make this loop work by show
Output:333
333
333
However when i do not put ( end=""), it actually showsOutput:3
3
3
3
3
3
3
3
3
So what i want to know is that what does this line of code does ( end="")Thank you!
rows = int(input("How many rows? ")) columns = int(input("How many columns? ")) symbol = input("What symbol do you want? ") for i in range(rows): for j in range(columns): print(symbol, end="") # what does end="" do ? print()