Why is there a "\n" in the code?

I am doing the Variance and Standard Deviation Project and it was suggested for us to use the following code. I dont understand why there is a “\n”. I looked it up and it seems it serves to make print go to another line, but what is the logic of using this in the end of the code?

image

for example:

for i in range(3):
    print("hello world\n")

gives:

hello world

hello world

hello world

while:

for i in range(3):
    print("hello world")

gives:

hello world
hello world
hello world

so the extra new line certainly matters.

3 Likes