5. Comandos de salida

5.1. Carácter de fin de línea

  • El comando print agrega un salto de línea como carácter por defecto.

  • Se puede reemplazar el carácter de fin de línea utilizando end en el comando print.

1for x in "aguacate":
2    if x in "ae":
3        print(x, end=" ")
4    else:
5        print("*", end=" ")
line that just executed

next line to execute

Print output (drag lower right corner to resize)
Frames
Objects

Activity: CodeLens 5.1.1 (cl_l40_5)

You have attempted 1 of 2 activities on this page