How python returns multiple values from a function
This article will explain in detail how python returns multiple values from the function. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Returns multiple values from a function.
There are not many programming languages that support this feature. However, functions in Python do return multiple values.
Please refer to the following example to see how it works.
# function returning multiple values.def x (): return 1, 2, 3, Calling the above function.a, b, c, d = x () print (a, b, c, d)
#-> 1 2 3 4
This is the end of this article on "how python returns multiple values from a function". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.