Created
January 31, 2018 06:03
-
-
Save Manuel4131/e7af0b3ee8e01eb31f1feca476d6a517 to your computer and use it in GitHub Desktop.
args kwargs
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
https://pythontips.com/2013/08/04/args-and-kwargs-in-python-explained/ | |
Workable! | |
---python | |
def stupid(data, *args, **kwargs): | |
print("data: {}".format(data)) | |
for i in args: | |
print(i) | |
for k in kwargs: | |
print("{} {}".format(k,kwargs.get(k))) | |
time=(1,3,5,7) | |
cap = {'uk':"London", 'de':'Berlin', 'nl':"Amasterdam"} | |
data = 'infor' | |
stupid(data, *time, **cap) | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment