This is just a cool Python feature.
There are two things that have several arguments: adds the space around the parameters as unclassified and converts each of the arguments into a string separately.
Let's see how simple we can make potentially complex code using the following functions:
a = 5 b = 3 c = a + b print a, "plus", b, "equals", a+b
If we did not have a list of individual parameters, it would look ugly:
print str(a) + " plus " + str(b) + " equals " + str(a+b)
From Zen Python lines 1 and 3:
Beautiful is better than ugly.
Simple is better than complex.
Check out the Python link for more information.
source share