Python 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010] on linux2 Type "copyright", "credits" or "license()" for more information. >>> def fun1(): return [1,2,3] >>> print(fun1) <function fun1
本节主要学习Python的函数是如何同时返回多个值的问题. 在学习Python的时候惊奇的发现,Python的函数可以同时返回多个值,很有意思. #define function sum def sum(x, y): z = x + y x = x ^ y y = x ^ y x = x ^ y return z, x, y #define function main def main(): a = int(raw_input("plz input a ")) b = int(raw_