You don't need to use the
anyway... this is all you need:
**kwarg
syntax to just pass a dict to a function.**kwarg
is used for passing a number of keyword arguments. Any keyword arguments the signature doesn't explicitly handle are put in the kwarg dict doing this.anyway... this is all you need:
dic = {3:0.2, 4:0.5, 5:0.1, 6:0.8, 7:0.34} def function(dic): if not dic: return dic else: dic[100] = 0.1 return dic function(dic) print(dic[100])