Curso-lenguaje-python/python-ofensivo/00_ejercicios/02_maneras_imprimir_variable.py

19 lines
402 B
Python
Raw Normal View History

2023-12-14 21:55:17 +01:00
#!/usr/bin/env python3
"""
Maneras de imprimir una variable
"""
name = "Sergi"
rol = "SysAdmin"
edad = 53
print("Hello, I'm %s your %s of %d years!" % (name, rol, edad))
print("Hello, I'm " + name + " your " + rol + " of " + str(edad) + " years!")
print("Hello, I'm {0} your {1} of {2} years! Yes, {0}".format(name, rol, edad))
# f-strings
print(f"Hello, I'm {name} your {rol} of {edad} years!")