Last active
February 1, 2017 01:15
-
-
Save AliYmn/bdc65774e0ebef547345347ce1b140b6 to your computer and use it in GitHub Desktop.
python @dekoratör fonksiyonlar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def arguman(arg): | |
def wrap(func): | |
def func_wrapper(name): | |
return "{} {}".format(arg, func(name)) | |
return func_wrapper | |
return wrap | |
@arguman("Merhaba") | |
def get_text(name): | |
return name | |
print(get_text("Ali")) | |
# Outputs Merhaba Ali |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment