Code: Alles auswählen
_MyDict = {"age":"25", "name":"Frank"}
def myMethod(**kwargs):
Name = kwargs.pop('Name', 'InitialName')
Age = kwargs.pop('Age', 'InitialAge')
print("Name:" + Name)
print("Age:" + Age)
myMethod(_MyDict)
Folgender Fehler wird mir ausgegeben:
###########################################################
Traceback (most recent call last):
File "main.py", line 17, in <module>
myMethod(_MyDict)
TypeError: myMethod() takes 0 positional arguments but 1 was given
...Program finished with exit code 1
Press ENTER to exit console.
############################################################
Was mache ich hier bloß Falsch?
Danke schon mal für die Hilfe im Vorraus, LG