How would i repeat a string but on a new line, but the last line does not make a new line?

For example the top part of the ship is an equation to see how high the lines go but i have a gap between the next lines for the ship.

Hey there and welcome to the forums!! :slightly_smiling_face:

Given this appears to be an assignment (though I can’t tell from were), do you have permission to ask for help with this?

yes I do have permission to ask for the basic things behind it but I may not ask for the exact code for my assignment. ie. i can ask for the topic i did but i must not ask how to do it with my work exactly. so pretty much i can ask how to repeat a string onto new lines but without the last one having a new line. i just used my work as an example for understanding.

1 Like

Do you have any extra newlines in your code? Or empty calls to print()? Typically this would be what would cause a blank line.

You could also look into more details on print(). It has an argument, end, that is equal to what to end a line with, and by default it is set to the newline character \n. By changing that to an empty string then it will no longer add a new line when it prints.

print("Howdy ", end="")
print(" Bob!")
Howdy Bob!

thanks for the help lol i just figured it out too cause my professor finally responded but thanks so much

1 Like