Get the App
SLTechnology News&Howtos  ›  Development  › 

How python returns multiple values from a function

Shulou Source: shulou.com Published: 2022-06-01 06:20:17 11月15日 Update

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.

Tags: Functions multiple articles more references good practical content functions working conditions situations articles knowledge examples programming languages languages work help support related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MySQL Apple Microsoft Shulou Information