miércoles, 19 de octubre de 2022

Python print sin nueva linea: print(" hola ", end="")

Python print sin nueva linea:

print(" hola ", end="")

https://www.freecodecamp.org/news/python-new-line-and-how-to-python-print-without-a-newline/#:~:text=It%20is%20used%20to%20indicate,used%20to%20separate%20the%20lines.


But if we customize the value of end and set it to " "

image-222

A space will be added to the end of the string instead of the new line character \n, so the output of the two print statements will be displayed in the same line:

image-223

No hay comentarios:

Publicar un comentario