Update Python Ofensivo

This commit is contained in:
2023-12-26 23:56:20 +01:00
parent 490afce41f
commit e300dee83f
6 changed files with 210 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python3
"""
*args: argumentos posicionales
**kwargs: argumentos nombrados
"""
# EJEMPLO DE *args
def suma(*args):
return sum(args)
# EJEMPLO DE **kwargs
def presentacion(**kwargs):
print("[+] Mis datos:")
for key, value in kwargs.items():
print(f"\t- {key}: {value}")
presentacion(
nombre="Juan",
edad=20,
ciudad="Medellín",
profesion="Lammer"
)