Last active
October 12, 2019 16:33
-
-
Save Rhyanz46/5a8bb4c8b1002a2e1123d6d81d5e397a to your computer and use it in GitHub Desktop.
sesi belajar flask
This file contains 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
sudah_login = True | |
def contoh_decorator(func): | |
def tak_bisa(): | |
print("kau tak bisa") | |
if sudah_login: | |
return func() | |
return tak_bisa() | |
@contoh_decorator | |
def coba(): | |
print("berhasil menakses coba") | |
@contoh_decorator | |
def coba_gan(): | |
print("berhasil menakses coba_gan") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment