mirror of https://github.com/JavMB/ejercicios
Fix formatting and improve greeting function in prueba.py
This commit is contained in:
parent
4e031680ba
commit
ed481d9b15
|
|
@ -38,6 +38,7 @@ while contador < 3:
|
|||
def saludar(nombre):
|
||||
return f"Hola {nombre}!"
|
||||
|
||||
|
||||
print(saludar("Mundo"))
|
||||
|
||||
|
||||
|
|
@ -64,6 +65,6 @@ class Persona:
|
|||
def saludar(self):
|
||||
print(f"Soy {self.nombre} y tengo {self.edad} años.")
|
||||
|
||||
|
||||
p1 = Persona("Javi", 22)
|
||||
p1.saludar()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue