Looking for extra enlightenment on *args and **kwargs, I came across the following short piece of code:
def concatenate(**kwargs):
result = ""
# Iterating over the Python kwargs dictionary
for arg in kwargs.values():
result += arg
return result
print(concatenate(a="Real", b="Python", c="Is", d="Great", e="!"))
The page says it would produce:
RealPythonIsGreat!
And it indeed does. With Python 3.7.2. But that is what it spits when I run it with Python 2.7.16:
RealIsPython!Great
It shuffles the terms in a totally nonsensical, Yoda-like way. Why?