Advertisement
urksiful

GlobalCalling Exercise 02

Nov 7th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. tupla_taller = ("Hola como estas", 19, 34.5, True)
  3.  
  4. def saludar(nombre, mensaje="Hola"):
  5.     print mensaje, nombre
  6.  
  7. saludar(mensaje="Saludos", nombre="Juancho")
  8.  
  9. def hola(nombre, mensaje):
  10.     print mensaje,nombre
  11.  
  12. hola("Uriel", 29)
  13.  
  14. def funcion(nombre):
  15.     return "Hola Mundo "+nombre
  16.  
  17.  
  18. def llamada_de_retorno(func=""):
  19.     """Llamada de retorno a nivel global"""
  20.     return globals()[func]()
  21.  
  22.  
  23.  
  24. func = "funcion"
  25. print locals()["funcion"](func)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement