17.python自定义函数

  什么是函数,函数说白了就是将一系列代码封装起来,实现代码的重用。

  什么是代码重用?

  假设我有这样的需求:

17.python自定义函数

  但是我还是觉得太麻烦了,每次想吃饭的时候都要重复这样的步骤。此时,我希望有这样的机器:

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAADqCAIAAACJEN+MAAATuUlEQVR4nO2d3YscRRvF/ZvqzUbFiAkBdYUYl0qyRtxIRBYv9CKUQdkbWRGRYKL0ioqKkggqrjiNHwSRvfCDgCSaZsmCropLYDUxidmMeiFG+73omZ6q7uremp7uqqd6zrnKzJzuPlPz/PqprpnO3hCrWl9fj43V7XYpmJHZjhmZK5tvyDwmEsvHoURmOzF8zAzM3JiR2Y6ZSGZg5saMzHbMRDIDMzdmZLZjJpIZmLkxI7MdM5HMwMyNGZntmIlkBmZuzMhsx0wkMzBzY0ZmO2YimYGZGzMy2zETyXxDV9X6+nrXNyGzHSFzZaGbuTEjsx0zkczAzI0Zme2YiWQGZm7MyGzHTCQzMHNjRmY7ZiKZgZkbMzLbMRPJDMzcmJHZjplIZmDmxozMdsxEMgMzN2ZktmMmkhmYuTEjsx0zkczAzI0Zme2YiWQGZm7MyGzHTCSzA8zm5ubYmGlubs7+ONduRubKZgeYua55N7I/zrWbkbmy2Rlm5hv6LmDm0Ewks4MbYcYTM/vjXLuQubLQzRoXuplDM5HMwKxxATOHZiKZgVnjAmYOzUQyA7PGBcwcmolkBmaNC5g5NBPJDMwaFzBzaCaSGZg1LmDm0EwkMzBrXMDMoZlIZmDWuICZQzORzOOEWSiYCO0fFpg5NBPJ3G7MVLCUR/aYA2YOzUQytxuzOI4CzngQxXEskxUKZq+xATOHZiKZ245ZHMdRwBPQ+piFog+eFQEzh2YimccAs1S4NhvNjMyVze29ESYKONtUNtpacqSbb75527Ztt912286dO++4447Jycndu3dzzqenp++7774DBw48+OCDjUfxTaMXG26EsatQcM4Z58LmfDGO42HuFrcczFMNVXVUulnmcTsxSy7PQsFEGAXc8swxeb9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SGZgZlXAzLKZSGZgZlXAzLKZSObW3Ajjh5JxaG6cGxUyV5bVbgYlam6cGzUjc2Uz/oygbbX+zwg2HcPHzPijuG7MyGzHTCQzMHNjRmY7ZiKZgZkbMzLbMRPJDMzcmJHZjplIZmDmxozMdsxEMgMzN2ZktmMmkhmYuTEjsx0zkczAzI0Zme2YiWQGZm7MyGzHTCQzMHNjRmY7ZiKZgZkbMzLbMRPJDMzcmJHZjplIZks3wjQqZLYjZK4sdDM3ZmS2YyaSGZi5MSOzHTORzMDMjRmZ7ZiJZAZmbszIbMdMJDMwc2NGZjtmIpmBmRszMtsxE8kMzNyYkdmOmUhmYObGjMx2zEQyAzM3ZmS2YyaSGZi5MSOzHTORzMDMjRmZ7ZiJZAZmbszIbMdMJDMwc2NGZjtmIpn/D+UJbkyosuCFAAAAAElFTkSuQmCC" alt="" />

    将重复的工作封装到一起,我们只要向机器里放入东西,就能得到我们想要的。

  这也就是所谓的代码重用。


自定义函数

  知道了函数是干什么用的之后,我们就开始学习自定义函数,也就是动手来造这个神奇的机器。

  看代码示例:

def dfb(a):
'''一系列操作'''
return '一碗%s饭' %a a = dfb('米')
b = dfb('米')
print a
print b

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcMAAABBCAIAAAAi61juAAAGs0lEQVR4nO3dy5WjOBSAYYVFCJNIKQwcQbPzpnsyYFvaOwo2ZOAkmAUvPa6EbAGmev7v9Knjcgsh9LhIsuugfgMAyqgBAFCGSAoApYikAFCqIJL2j6p69KUF6LSqlWpNaT6S65fwHKZVO9TDLud6NlW6Mju9XdU5aT4ht55371G7VshxveXMfni6WCQde/xNqZvSXTzNvbEqxuj5EHXTLzTsW/2gf1Sqds9llXlqML+E77ra0M1pHSexNlPraDP0zT3vwDcLNjdHrNLSlflsvjYHW06a89nXvmnfHvVsqr1ye+kqLpLzJciRtG/uVfMchmEYOh2/jVjJhinx2D/6R5XsKH3zsP73jV5ljSXTzrf3rpnLbObsghLmKi7hgTJbZ7JOBJ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mn6+2dbrSN9lOzvDIrfprLPbm1OWfUTHCVPSJ0dZDPMc0DdalWr6te8kzj9tDYH/X12p1b9NJGrsFtQvopl37b9qmrra3O1VBv2Pqmbj1TPRrdmeBpjnctv065pusbph27PjJVZ3kN3mz7sP3NuQiPKLSil8XOO9N7Tcpbvjjmj+xC7/I1TOA93SCvuky0ljE1aP17CfZ353b2//HuCSTte++bSNW7rS4db/prvkH5ydB/616Ld+tnZNUwf8jpz2GuVEP9PQc/MsWwv7vLnJz/eZ0c3f3cPAKWIpABQikgKAKWIpABQikgKAKWIpABQikgKAKV2jqRKpTKM/W/i/XSGAHAF78cpNbNf25Zk9iE5r70cAODiiqKVGC7Dd8JkXnovKJcUCQDOt08kHfLW9WKs9MIrkRTAj1O0uvd+9Vb6Q2TVL67f7XgaSwMA17TbPqn4MzwklpX3OrFvAABXk/rQPD2XzPkp5imezntNJAXwg5Su7r2F/BCJmJtBNjMlAFzQDpE08Y79vvgiPJBICuDH2WefdIh8BO9NTr3X9iGb0RYALmu3OakYScVDEu/nZAIAV7NPqApX6y9FUu9/Y9NYALgm4hQAlCKSAkApIikAlCKSAkApIikAlCKSAkApIikAlOLpIwBQiqePAEApnj4CAKV4+ggAlOLpIwBQiqePAEApnj4CAKV4+ggAlOLpIwBQiqePAEApnj4CAKV4+ggAlCJOAUApIikAlCKSAkApIikAlCKSAkApIikAlCKSAkApIikAlCKSAkApIikAlCKSAkApIikAlPoPeDqGkeEo72oAAAAASUVORK5CYII=" alt="" />

  这样我们就得到了两碗饭,真是方便快捷。

  现在来解释里面都有什么:

  1. def 是python的关键字,是专门用来自定义函数的。

  2. dfb是函数名,用来以后调用的。

  3.(a)中的a为函数的参数,为函数里面的操作提供数据的。

  4.return用来返回一个对象,这个对象可以是函数的处理结果,也可以是函数的处理状态等等。


1.def

  没什么好解释的,语法规定。

2.函数名

  函数名就类似于变量名。

  例如我写了一个函数,但我不调用它,那会怎么样。

def dfb(a):
'''一系列操作'''
return '一碗%s饭' %a

aaar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4BmO9yROujqZbbsy2b8zjNBcAfg4o7Atm3/chsCCqsOcar7f2ME1nxrUXaSz8Sg4Vtt2rBLZX6qZUb5dK6HrSlh+347SXSpUepkybvQSxnr34SsBouq1qsYy+ueQ53BvTKXVb8qawTXKsQQe9kvOaTTVd5n4zaNVq3St107rPeLhdcWaRHD0xf9efeaadGZ0ybtVYBcul9UrMPW4TRsNdlw+5QwNcSl0O611pfQVcU5Xx3izXU6XSZtUFR9EiyzWH8LDjoFXbmEfxhKfn5feKfXZmmnHV6s6Mk9W9HQc7usZf8Dkg6U9vw8LrC4HNr5e3psHcY38CUFiAVxQ2dyX+xm3TRpnUloUFzXI5UaVLSTdyLjmPsYlZtHGmmZngiu0bc4/eDXjN53jiyRgG4XpBYZ9a00J8AqgSAJygsIUcdvuMxTls42POYc3yOLyf2OjKay7VKGxi9Oib2Of1iu3zT9yDVq02WyiOfLZDrXan/ent8rV+rKTlzHrFOew+99ifED7pAigpbPiqjVPU8w5MrmaXqGlulb71PZ7SlYjNSFhj3d4nWxMrPWxFye+wTTxWopedUtXJ+be616rNOWl1b6eHtQ+vS/jG2+pAYfTC9LdezX10X6c9HitDdr2iNXXnHscnhLe14LfzA//iAADgh4DCAgBIgcICAEiBwgIASIHCAgBIgcICAEiBwgIASIHCAgBIgcICAEiBwgIASIHCAgBIgcICAEiBwgIASIHCAgBIgcICAEiBwgIASIHCAgBIgcICAEiBwgIASIHCAgBIgcICAEiBwgIASPE/xoNJboa6Vh0AAAAASUVORK5CYII=" alt="" />

  什么也没有输出,那是不是意味着函数不存在呢?

  我们看看内存里有没有:

print id(dfb)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbgAAAAnCAIAAADy78rGAAAGQUlEQVR4nO2dy5XsKAyGCYsQJpFWGK4ILrtazWTgbbGvKLxxBpWEZ2GwEYiHq/yonvm/c0+fLrcMQgghZHdfNQEAACiiPrp7fGr9HD/VYSDVKdXbT9uR+H4Nz8H2agc77NLXy+iyMQeqm7pF5gp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qy+OveFxr78Jyle7ifY3PH7+HzRnW2rLt1c6BMtVnys9g0jKrp0d3FWa5bOeOTORgqVXTllv6as8oQx9zGgorZR1pWmPNWGMqeO+ZLac0ru7NtLweVD3jLGdbf0t6YLQ9T/28JA3rZkIDqyMINYtQ5p+/1i3oJpXhRA1ngbvWvnJxoIZLLOCwatFythqkGmX5xaza7EgPYeOqnPiaUdh7UBgK7JPcJaeTrHprJ5/BUU+qU/qPr+K5r0FhLq5xM6vGMplRhDMoj2KpmfY/ugveJ+ska4Q1St6OZGdLvZ1e1gZ9xXM6GDMY5ofcM3M6y/VrPvWp//jWhEmUZ1CSiVvOeO9pLcubX8vq3sxnL5yvpEkyQzoOn8yiYS7lvFzDfTnznbVf/H7cx+w49uq5Mk/tbbwa/5l3J49a3XsFyhzD+tTpO3CPR1kG+l0agv8niWe2sJT2dvmtil/Pcav76EAJAAC/HgRKAACogEAJAAAVECgBAKACAiUAAFRAoAQAgAoIlAAAUAGBEgAAKiBQAgBAhWqgtKSi19qDK5aUx/9Fv+SKuxx8yshU+gIAgIuoBEpLcTQLrlhS2v3ilCWl6DFZ8hem0ehZzIXF4I/1pTL1vgAA4DKKgdKSImI5HbsyGr3EvCD8rZJW/CDLVPoCAIDLKATKOfbxYJZeEc/ZQmqYnqkVi6T1vgAA4BqygdJXFddQlV5ZLoW55XJ/e0bZ1BcAAFxE4f/MYfw8rHSFnZzzz2Fy8c7SXNms9YVgCQC4kE+eeltaQthodPQwJ3jSEwdNWabcFwAAXEYxUI5Gu5TOx7PoSiqw5oItrxAFQbDaFwAAXAReOAcAgAoIlAAAUAGBEgAAKiBQAgBABQRKAACogEAJAAAVECgBAKACAiUAAFRAoAQAgAoIlAAAUOFfZfLuj/mvh9IAAAAASUVORK5CYII=" alt="" />

  很明显,函数在内存中,能够找得到。

  所以,当我们定义一个函数的时候,python就会将函数加载到内存中,只不过不调用的时候,函数内部的代码就不执行。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc4AAAG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ybHNGllp0QmrLss0ZWWrRia9N7Y9Z2e12zyCXsPluucSUtyy1eCD74zfjeR7Krmptvl+efbPU4oG4gVCWbc7IUotOSG1ZtjkjSy06IbVl2eaMLLXohNSWZZszstSiE1Jblm3OyFKLTkhtWbY5I0stOiG1ZdnmjCy16ITUlmWbM7LUohNSW5ZtzshSi05IbVm2OSNLLTohtWXZ5owsteiE1JZlmzOy1KITUluWbc7IUotOfG1qd7fYPwHse2Fzhtk3Sy0eyP74zXukD7iqtfl+2VUtOuEGQlm2OSNLLTohtWXZ5owsteiE1JZlmzOy1KITUluWbc7IUotOSG1ZtjkjSy06IbVl2eaMLLXohNSWZZszstSiE1Jblm3OyFKLTkhtWbY5I0stOiG1ZdnmjCy16ITUlmWbM7LUohNSW5ZtzshSi05IbVm2OSNLLTrhIYplbM7gIYrohIcolmWbM7KrWnTCDYSybHNGllp0QmrLss0ZWWrRCaktyzZnZKlFJ6S2LNuckaUWnZDasmxzRpZadEJqy7LNGVlq0QmpLcs2Z2SpRSektizbnJGlFp2Q2rJsc0aWWnRCasuyzRlZatEJqS3LNmdkqUUnpLYs25yRpRadkNqybHNG/qLUAg9kxvM8lD1E8Vmwebfb/fbbb49+oeGn5rfffpv3SB9wVWvz/bLNGdnmjPylm6XW5vtlmzOyzRlZasuyzRnZ5oxsc0aW2rJsc0a2OSPbnJGltizbnJFtzsg2Z2SpLcs2Z2SbM7LNGVlqy7LNGdnmjGxzRpbasmxzRrY5I9uckaW2LNuckW3OyDZnZKktyzZnZJszss0ZWWrLss0Z2eaMbHNGltqybHNGtjkj25yRpbYs25yRbc7INmfkL938f72P/ziSbw/wAAAAAElFTkSuQmCC" alt="" />

  很明显,和变量赋值原理差不多,所以要注意一个问题:如果函数名和变量名冲突了,相当于重新赋值。而python解释是从上到下的,也就是说此时谁在下面谁占用这个变量名。剩下的那个就只能在内存中等待垃圾回收了。

def dfb(a):
'''一系列操作'''
return '一碗%s饭' %a
dfb = 1
print dfb

  aaarticlea/png;base64,iVBOR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yS2Kr4NWFcYyrRvm3BVr8Mht7fsIvr8itszpzNav4eNlbzMee4dO2Fn3SeT1ciZa86ejci/FyqYJXorPrUqqBy+hMerE2zMXL3oYAfCVVv+yKNiU3hlEdPBPViJr7RXnG9D05WkeKrSzl5IT5ZabNBme9Y80qCskvZ2pWxWqTzKxXMphsTZ90XkuXfK/M3JlcbWsFLyaTLi+DFFep/3SJY9/mRY7QXv8jNuR7URsC8IVs/F7JU63NYAJCFEICAMDMWr8cvI/hQI2olfhXU/DaAACA4Tf5HjYAAHwN8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX8MsAANAX/wfOyKxDWOpM5wAAAABJRU5ErkJggg==" alt="" />

  那么函数名的命名有什么要求吗?

  函数名的要求比变量名严格一点,除了遵守变量名的要求之外,还不能够使用数字

  所以函数名只能使用字母和下划线(_),同时还要避开python的关键字。

  另外,在pep8标准中,函数名提倡都要小写


2.函数的作用域

  参数函数的一大重难点,很多人不明白所谓的形参和实参到底是怎么回事。

  要明白其中的区别,首先还解释函数的作用域是什么回事。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAs8AAAJaCAIAAABfuz0QAAAgAElEQVR4nOyd+bsU1bm2v3/pVIEjJMBxQuUk2E6oiRJF5Rg0WqKyI44ooiJSCaioUUGjqIkFDkgc0DgFRWjNISo5ih7dTonTVhAQeb8fanV1jd2rqmu99Vb181zkirv3W6vvXl1V696rpv9HehkdHdWsJKKxsTEJxWDmKQYzTzGYeYrBzFMMZp5io8y58v8060ZHR/M2XXnAzBMw8wTMPAEzT8DMEznM/0+CHxkqBjNPMZh5isHMUwxmnmIw8xQLmtuQQGyoGMw8xWDmKQYzTzGYeYrBzFMM2+AoBjNPMZh5isHMUwxmnmIw8xTDNjiKwcxTDGaeYjDzFIOZpxjMPMWwDY5iMPMUg5mnGMw8xWDmKQYzTzFsg6MYzDzFYOYpBjNPMZh5isHMUwzb4CgGM08xm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sjTJjp9naOGhuZM2NbG1gFmujzNhptjYOmhtZcyNbG5jF2igzdpqtjYPmRtbcyNYGZrE2yoydZmvjoLmRNTfyo2sDiHENNhk7zdbGQXMja27k68232+277zv4cdxuN9dgk7HTbG0cNDey5kbW3MiaG1lzIw+tjYve28xXa6+juUFzg+YGzQ2aG3aaPdt4eobmJkNzk6G5ydDcZGj+Soa1cdDcyJobWXMja25kzY1sbRSy5kbW3MiaG1lzI2tuZGujkDU3suZG1tzImhtZcyNbG4WsuZE1N7LmRtbcyJob2dooZM2NrLmRNTey5kbW3MjWRiFrbmTNjay5kTU3suZGtjYKWXMja25kzY2suZE1N7K1UciaG1lzI2tuZM2NrLmRrY1C1tzImhtZcyNrbmTNjWxtFLLmRtbcyJobWXMja25ka6OQNTey5kbW3MiaG1lzI1sbhay5kTU3suZG1tzImhvZ2ihkzY2suZE1N7LmRtbcyK+3NgAAAD7HXy48hlUOR417AAAAAElFTkSuQmCC" alt="" />

  所谓的函数作用域,就是这样。

  python在执行函数里面的代码的时候,会将其放在一个新的环境中。这个新环境就像一个虚拟机,虚拟机能够访问和修改本机中数据,前提是该数据是可修改的,但是python在函数调用完毕之后会自动销毁这个环境。但是,如果我们在函数中试图修改一个不可变的数据,也就是进行重新赋值的行为的话。

DEBUG = True
a = []
b = 123 def test():
if DEBUG:
a.append(1)
b = 321  #重新赋值,先进行对象创建在进行引用更新。 test()
print a
print b

 aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYIAAAA0CAIAAAAIfKgCAAADYklEQVR4nO3cu3XbMBiGYYyFEbKIMQY1QdCpywZsg15TsMEGXAIpSJC40lQo5XeS9zk+OrIM4q7PtCVKhZy3d23nEEIIkzFTOOTMYFxYC6vRlT+frR5U9ngs5iaXHbXdma2+Wx+Cf2j98K0y3t5jo8HbhytqPuphUfO7etgSjwoh+Nmvj4xuve2VKZ1bndnqbdTV2GNX7VZPMa699Xo4zaPytvzjYy0TnFkqjDW7Uanx53psehvyOotvj8pU/Qn9Faxq3mejPupglY/neTC22GD1rNY1n2mr3r1FyeYeW3vYeKbsIy1G0Z+NcLB7L9WsQml5Zt7aT86CG5WZ9kOyCVoLxKdNXrmZljVb77txb9E/tBrUsjCNMj++LY8sX3uLxz1cCty1HpS6ZVPz+h5uz7TcelRSs3749fBYOCvTdGJ13FgvhLf3Zcbi2Ld6krbS1tex3JS6JfNTHVW2tQwnnZllz41K3ZQZjRqU/q7UzZhxu9V2TpszrjOrZZnOKNIVbI8i9kePH3qI/U/XPZ2NLUCrelrz7Mzowuxc0la5ppO1k832Yb4ze33Odl1n6ev9E2trLGJ7BVtlypo7u/dKzWWx58Qg73Cmd3bwx2w97J0uiffwtZq/gv6Btr6aF4794CT6M9kJ3W943wo+V/PFGOpZf5t9nT3qTHG+9uV6iP9TtTPPiGeLhycBf5E3xRAAnEUMARBGDAEQRgwBEEYMARBGDAEQRgwBENaOIWeUUkop3X5Xgrd6+TnvugFwWSeG7Jl3RXlriSEAV52NIWfqMx9iCMALnIih9S80YgjAW5w8G3KGGALwHsQQAGHEEABhxBAAYcQQAGHnXymrXy0jhgC8AO+iBiCMa8oACCOGAAgjhgAII4YACCOGAAgjhgAII4YACCOGAAgjhgAII4YACOtdzJFcprFdurFdvNG9ygwAnlbFUPmRr95+xAvLnFHK/AzObJeaeasJIgDXNM+G0o/16N1vPwAAz/o0hnbe6uSKe2f4kwzAK5yNoTyDDgoCwHNOxZAzvU8eIocAXPV5DHmrk/9X2+xf1P18AoCTeq+Uba+WJd9vH8e4P8apEICrePsiAGHEEABhxBAAYcQQAGHEEABhxBAAYcQQAGHEEABhxBAAYcQQAGHEEABhxBAAYb8Awa/M2k7eQ9gAAAAASUVORK5CYII=" alt="" />

  就像这样,我们在函数内可以访问到全局变量,也可以对可修改类型进行修改,但是当我们试图为变量b重新赋值时,却发现没用效果。

  因为函数在运行完毕之后就被销毁了,而在函数里面新建的对象也跟着被销毁了。所以我们为b重新赋值,打算新建一个对象来改变其引用时,却发现该对象在出了函数以后就消失了,这样b岂不是没有引用了?python不会让这样的事情发生,所以就引入了作用域,函数内部创建的对象和外部是隔离的,互不影响的。

  所以作用域问题单纯只是针对对象新建问题。

  也就是在函数内新建的对象会放到一个盒子中,这些对象只在函数内有效,且与外层对象隔离,所以做到了就算变量名冲突,在函数内的赋值也不会影响到外面的变量。

  函数内的变量就是局部变量,外部的就是全局变量所以在函数中定义的变量,也就是局部变量,只在函数内部有效。


2.形参和实参

  形参,字面意思,指的是形式上的。

  实参,则是实际上的。

  看下面这个例子。

a = 123

def dfb(a):
'''一系列操作'''
return '一碗%s饭' %a b = '米'
print dfb(b)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdkAAABACAIAAADZO5pqAAAHEklEQVR4nO2cy5WrOBCGFRYhTCKtMOgIRjtvZiYDtq29o2BDBk6CWfDSoyRkX4xs9/ede3wwFlKpVPwUBX3VPwAAUBs1AgBAbdBiAID6oMUAAPU5QouHa9Nchz/tpdeqVaqzBxgU8foWnoPt1AF+OGSsm2nyzuz1vqtL2tSg1M+HR9ShDnletJwZh+/DrhZP58y3Ut9K9+k2F+O41urlEPWt7wiNhyJpuDaq9cdybJ6XPLTwUV7t5C9ZHa+xtvPqaDsO5lJ24IOGLcuRclremTfztXu6lrQ5H3fuuxwbUTfTHNXbXbN4kZ7fmx0tHsylMbdxHMex1+lLmdNsnBtPETZcm2yoDebq/PpAXDpno+2WFKM3i8126S6ysJQ/tvCJFK7OzJaMrLN42nTcxGe4Nko8905ypr+Czz1qHO9N+upHlDxTfxZH+vB5Pb85O1rsppPO/KMACosAhVoc9PNAXLqHhId7C/ZgmeLPLXwet9LVmRvHieqTpuMnPrZTutNC9n2OMx8b5WHb7k36qkfUbrSk2rxaz2/PjhaXz9nqwMVu3WD+qu2UvX4r1f3MG9O/TRqMuSj1veWwcwliEp25vha2mRpGubnxG7gWWt0q1WndLv2cYaGHcNTFDH4B0WsTc09EesmIoMVbWcnPZ+fRF5/YeWf6qHCsye3+vfPUW3NpVPevuS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A9aDABQH7QYAKA+aDEAQH2epcVK5XpO/ZrZn+8QAOCtOUDg1IK77bI2cw8p2Q56AAD4VI6ROVFw4z1xs6B9IOuH2AYA8PocrMVjWXVCVNtAoNFiAPg9HFOjCL4G9YoxUbsQqxCuIqfaAAB8GMfXi8XP+JBUV8F2pvoBAPAx7AhcST5b8in2KQ4XbKPFAPAbOKxGEZQjxoTm7sp0YUsAgE/iSC3O7HH3ixvxgWgxAPweDq4Xj4nXIYIEOdh2D9nVawCAz+P4vFjUYvGQzP6STgAAPoaDNS6uOdylxcGvqVQaAODDQOAAAOqDFgMA1ActBgCoD1oMAFAftBgAoD5oMQBAfdBiAID6oMUAAPVBiwEA6lOkxVZru34ZTLP8BxTzXqtVsAcAAO5hT4tnnV01djBfZth+0j+j1c2yZzANagwAcD8lebHVm8KmtuUdAABQwr1avDGYZk2I5/wZIQYAeIgHtdgX4kxDAADY5xEttloJQiy1BACAEu7W4sE0zoM84z27S4s0AABkKHyPYn2Xwvmu1Ky82z6SYgCAR+BvPQAA6oMWAwDUBy0GAKgPWgwAUB+0GACgPmgxAEB90GIAgPqgxQAA9UGLAQDqgxYDANQHLQYAqA9aDABQH7QYAKA+/wN9lvnFSz0BYQAAAABJRU5ErkJggg==" alt="" />

  我们传参的时候,相当于在函数内部进行了 a = b 的操作。

  因为函数是有作用域的,虽然外部的a=123,但是函数内部是相对于a=b='米',是一个局部变量。

  而局部变量在函数执行完毕就销毁了,所以它是形式上的,仅仅只是函数内部处理时用的,更像是一个标记,所以称为形参。而当我们调用函数时,实际给的参数,如这里的 dfb(b) 中的b这个实际的参数,是实际在内存中有的,所以就称为实参。


2.global

  如果我要强制在函数里面进行全局变量的声明怎么办?

a = 123

def dfb(a):
'''一系列操作'''
b = 1
return '一碗%s饭' %a dfb('米')
print b

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeUAAABtCAIAAAAQxu40AAAQxElEQVR4nO2dTbLzqhGGWUkyzBZYQjZidhF5BZeZJ7nZga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FwDgVZjWenmMz796NfHHy8jZ3/705ytjoxDu0wQu7YO689N78fN8aT4wMkOYlePHr4ky9btkVF6x9b1oY1M2sjgXmnZpz/K1Z/pFxNyrGdSsNoQYXbGo7/ZPcshK+dtSHaZ1AQBeA+/LAABAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH8BeAwBAH/wfHc+L5XGZqD8AAAAASUVORK5CYII=" alt="" />

  此时可以使用global关键字:

a = 123

def dfb(a):
'''一系列操作'''
global b #我先声明我要创建一个全局变量b
b = 1 #然后我再为b赋值
return '一碗%s饭' %a dfb('米')
print b

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbkAAAAoCAIAAADsexMtAAAFoElEQVR4nO2bwZXcIAyGKcslpJGlDE8F4eZLkg64Lvepwhd3ME04B4ONQCA8a3snmf97efMysxiEJISQbfULAACAhJoBAABIIFYCAIAMYiUAAMgcFyune9fdp6/2MmrVK2XdERKlvL6E1+CsOkAPh4z1MF1dmaOWVd3S5jto1fPhHnWoQs7zliv98AgaY+Xi0zelbkqP5TaDiabudLhE3fQO0z1l6eneqZ6OFcnsTZJK+CyvtjhbrEMaa+eto908maHtwicFC+YoKa2uzIf5EJdTS5vriecucqxHPUx3VG+7ZvEiPZ9FU6yczNCZxzzP8zzq8lYQNZt948UDpntXdYXJ3KO/PuE30WpxNmzRowkyu9BdJmErX5bwRBqt49k283UWp00nThyme6fYtXGRMqkFz71qnvcmTd/vUfxM6SyO1OF5PZ9GU6yM07FIvszA6SG3MVYm/TzhN/El6eVEoU8ew78u4Xk8Wq3jG+eJ3knToYmDs0pbzWSv1yjzuVGelm1v0vTtHiV6S6nNq/V8Ik2xsl0mpxMVxOdi/1W7Jfu7KWU//X+Wf9vSNWZQ6rblgP6IvQQFX99J2ywNs9zW0AaxhE73Slmt+9DPFRISmKsGM9ECFmmTs8djyGb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WAgCADGIlAADIIFYCAIAMYiUAAMggVgIAgMyOWOk03mcBALwpbbHSaaWUUoiVAIA3pT2vdBqxEgDwriBWAgCADGIlAADIIFYCAIAMYiUAAMjsug+Oe+EAgDcFz6IDAIAMYiUAAMggVgIAgAxiJQAAyCBWAgCADGIlAADIIFYCAIAMYiUAAMj8Bar53ZDt78NYAAAAAElFTkSuQmCC" alt="" />

  这样就可以在函数内创建全局变量了。

  此时有机智的同学就要问了,那我在函数内部声明的全局变量和之前的冲突,是不是会重新赋值呢?

  答案:是的。

  但要注意一个问题:

a = 123

def dfb(a):
'''一系列操作'''
global a #我声明全局变量a,想要覆盖之前的赋值,而传参的时候,相对于进行了a=b的操作
return '一碗%s饭' %a b = '米'
print dfb(b)

  然而报错了:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdUAAABMCAIAAAC0xbqfAAAORUlEQVR4nO2dTZLsqBHHOYm99BHMEXyR4hZTfYJhV6uZnXfW9rHzoi7xFI7RDfoSeCG+M0FIpY/q1/9fdFR0qSCBBFKplATCAgAAuAJxdQUAAOCbAvsLAADXsNX+Tk8pn9OrpY9K3IUYzKtyON6/hudgBrGDHnYp61PLtjJHtazqnjRX0Kvn3UfUrgo5brScOQ6/Dqz9nefJhxAfQo2VjJ9aPnSiTqN8FvGhVgyHTaNnekpxz8tK6uy6uazhVt5twvf0TpZYGdc7ythJP/oybqyY746a0trK/NS3xSnak+Z80rYvsu+I+tRyL2mrWvEmkr82jP2d9EPqT2uttaOqn7KSZNYlnkfV9JTN4TXpZ/LrhrGYzEAzeFdi1L7OxosjNezl5RoeSGfvOKLTEVpxWHNSB2d6SsHOt5OUmffgsbmsXevcXT+i+JbmrdhTh8dJ/uIw9jd1G5M2k0FTXuB32t9CzoaxmGYps2edtDEE8XoNj+Ozt3dcYuqQHtSc3MExg1CDYrzsc5S5rZTNdVvr3F0+ohZHSy3Nu0n+8jD2t7+dRhVqTWMC7qsys5f6IcTww/0z/0VzoPVDiI/oq7rwwmx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cA+wvAABcA+wvAABcA+wvAABcA+wvAABcA+wvAABcA+zvQfS8RIcX7QD41sD+HkS6wNsraewGMz0vs7mw59OJcjwdO1GtK72179QaOQBcA2d/k9UV7l0GYjujEnEl319nEbJkmaGX0viUW16S3su53tdJXytt1ZZUO5YLwBkw9jexC50OWuRT65WjPE6MUWMphh2B/X2lXADOgLG/Q7KE2Ep7umGUz1kOmh7fedbB/r5SLgBnwMUf5kUaReIFhz17jPoQ4jfxrz+FuAv11DKuAOmXNk9jbfl+P3O0Tj6nNGznhLuvrmg1um2K1E9yhNnHqJZmAVeNrBV5nT+1vAv5kG7JyrhCZr6LUieV3Y/adVQ0dhmCNs3oELE4tM7FWqB8DZctF9fLpVaZnagqjaXbSjVbwew7ta0VAJxP/f6bUenquiEQ4aMEZnC/rtqTYnpKNWYBTer/mqG0LPRIsiORjPVZH62mrcj++emWdQ+fjV2Uesqq2JTejOzXzlxUY9NTBovJtP2F3UmoVtkdpBbl9LSC7ju1rRUAXAAX/828vOjJPvRkjfI+Rd8oZ/b78RtV0CzGVMxT48hmo1ZvRVLnn9npob2LUk9p3O5HKyqZHln0vhfPhZzG+P5aqm2Zq1FWS1rwW+s7qPZJ3tYKAE6nef8t28uneHioaX8LS5rtv6lG91nICU5xj/1l/aBd7G9W54r9ZXdR6i6r5QO2K+m+PsNFycKzWZ3+b4jyszXs9n9jLva6h+4g1a5wZysM2XdqWysAuADG/sbwoig3r4zhiBA3zAKU07wDUHySLNnv57d/3v7tQgQx/ls+f5ZEAGlYOdugiMR/uU2MFi0U14q0zn/7+4cQg1Lh08knkdMu6O5HfVnyaKZTcqP04EhmCqHxXy+cRGldDf/Hymm2a+7lqlbTnaiWGtvXCm7fqW2tAOB0Vrx/MSp4EOA4EK4F344e+5s8/wDAYfAOLwC/Lnj/GAAArgH2FwAArgH2FwAArgH2FwAArgH2FwAAruH/5LgznAXnYAwAAAAASUVORK5CYII=" alt="" />

  说明我们不能将形式参数声明为全局的。

  那我们改一下形式参数的名称:

a = 123

def dfb(c):
'''一系列操作'''
global a #我声明全局变量a,想要覆盖之前的赋值
a = c
return '一碗%s饭' %a b = '米'
dfb(b)
print a

aaarticlea/png;base64,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" alt="" />

  可以了,说明我们的思路是正确的,在函数内声明全局变量确实会覆盖已经有的变量。


3.传参

  传参是函数的又一大重点和难点。

  传参是为了能使函数适用更多的情况,我们在上面的示例中都写列带参数的函数,是不是说函数一定要参数才行呢?

def test():
print '然而我并没有参数' test()

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAb0AAAApCAIAAAAuzGDyAAAGsUlEQVR4nO2bz5XrKgzGKcslvEaGMpwKrndZvdeBt8M+VXjjDtIEb+F/gCQQHtuTm3y/c8+cjEcWQsBngXONP4rx0TSP8adeBmtaY3p3REQprx/hNbjeHJCHQ9p6dk0+mYMtp1pj8xto83z4jDo0IefNlivn4dEYndk0v2/G3IwdZJt7F6TB2eUWc7MVw7hr1MdHY9q4rSDmeXjSCPfyagtVMzqRsXXz6Fjnx+6uu3FnYMtwSEnLJ/PZfRWXlsbmesK+Fzl2Rj275ihvVb14Ec9XoNLNsbs33dN77/1g5UdEYOZn42k2jI8mOy3G7hH8dcccClaO65dH99AtMbvFHYlQy48jPBHl6MxsD/m1F6d1Jywoxkdj2HVyUTLjETz3Lu9ri6nfn1F8T+NeHJnD8zxfgko3wzItiJUMdroRVupm4mfHHApvSW+Pkrtzq/7zCM/jqR2d2ZgWgCd1Jy4oXG9sb5mq9ppk7mtld2y1xdSvz6jibJFsXs3zRah0Ux+fs0k6wr3z/Kt1U1V4M6b/nj9M/7Zl3HV3Y25bbThvwyeBmM+DUpvJkNS8XWwQRuhsa0xvbbv4uSLCCOauezfGB16RDaVm9kQPeUY3t6OVuE6cW19y4uaL8l1pW1Pa4/3j5K25N6b/t7sbc2+a1jT9V9POGVub2wImWU1tuHjiEfwWejGfV6znPMy4q7IR932wprW2N+ZmbS+P6WCjeUhmptQWnRs0IdRmPdSaHmNsT5MRLGaDnb3Xe06nQWF175bdg3XTuz44KaNLettIuo4u4PXXdunndH0pqbZqkdp4z27D3SOVmzTC1rrY85kRxqyl4tropCzhgR21SdDrpvSQzxSetPXBmtawu4pcW7MfZxdNDDNm+m8/2HlhTD+l3QObVc1ugPEj9CLjmR9lsh+P+u7s1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jsF3QTgk6l+L6T5rNFNSYAkpaOSlw9GusLGmVdM6ge6CcAnU/3ORF88Srop6VRVo5nmaFtF8WUDYz0UWwQAvD1HrvyibiZlpo+lqljfZa5oxJe9KIlpbQUKAPgcfvReyGf1Rao3JQO9blLh87EESzdmLobepKpTih8A8FHs36fnNTS0p6qXFya9/CkFLm8glZxSYKg6AfhwsOwBAKAO6CYAANQB3QQAgDqgmwAAUAd0EwAA6oBuAgBAHdBNAACoA7oJAAB1QDcBAKAO6CYAANQB3QQAgDr+B1DGr0a+VTTDAAAAAElFTkSuQmCC" alt="" />

  可以看出没有参数也是可以的,只是没有参数的时候,无论怎么调用得到的结果都是一样的,灵活性太低,所以为了提高灵活性,就有了参数存在的必要。

  而参数又分为普通参数,默认参数,动态参数,下面逐一说明。

1.普通参数

def test(a,b,c):
print a
print b
print c
test(1,2,3)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaoAAABPCAIAAAA1ExYkAAAGrklEQVR4nO3dzZWrNhiAYZVFCWlkVAauINp5k6QDtqO9q2DDSQNugiwQoH9kDzAOep+Tc8+duULo90MI7Ih/AaBK4i8AqJIYAaBKhD8AlSL8AajUz8Lf8Giax/DTMvRStEJ0+qf5xHx+Cc+hO7FDO+xyrqdq8o3Zy+2mLknzG0rbefcRtWuDHDdazhyHBTLhbxqmNyFuQvbpNHdl1UbL+RBxky/0xludNzwa0brnsspsWtkv4bs+bb6V9I6TWGrTO1KPg7qXHfhmwebuSDVavjGf6mtzhpSkOZ9d9037jqinavbK7aVafEjOb0qGv0HdG/Ucx3Ece5kO2Fay0SSeOnV4NNneHdTD+tc3hoI1AXQ3X0h7NZdZz9kFJSz14xIeqLB3jPWSu9TisOrYl/fh0YjocD+pMd0ePPaocXx1afP7IypeU7cWe7bhcTm/Kxn+7EWTdcqgz/y7y8Lw5+XzxlCwD/EPd9rozfvfn5fwOM/S3jGJw+XYQdVxL++6E7KTkTXmOY353lneLturS5tfH1GboyWV5tNyfl8y/JWfRku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PfYTLVEfshvRkSwlTy8NfL+G+znzH6uPe5zrRjnXfvLNL23rPbMtl3vV7bXYf/aG3fn3y8hnMI0JntfhZJUSdgpFZYtky2+Xd/v+9V2c3n/kFUCnCH4BKEf4AVIrwB6BShD8AlSL8AagU4Q9ApQh/ACpF+ANQqY3wpyWfhgBwTenwp6UQQgjCH4Bryq/+tCT8Abgowh+AShH+AFSK8AegUoQ/AJXafPLL018A18RrzwAqRfgDUCnCH4BKEf4AVIrwB6BShD8AlSL8AagU4Q9ApQh/ACpF+ANQKcIfgEqlw9+gGj7zC+C6kuFPfalh+puWBEAA15MMf9ZXXfG1VwAuaHvvb1BNMy8EAeAyNsIfsQ/AVeXCn5aC2AfgqpLhb1DNsuE3KMXeH4CLyTz6sLAIBHA5vPYMoFKEPwCVIvwBqBThD0ClCH8AKkX4A1Apwh+AShH+AFSK8AegUoQ/AJUi/AGoVDr86fVTv3zZKYDrSX/lwfI1B4NqCIAALqfg5pfvugdwRfnwpyW3vgAuitUfgEqVPPkl/gG4oIJHH/wvPwBcUcmLLyz9AFwQrz0DqBThD0ClCH8AKkX4A1Apwh+AShH+AFSK8AegUoQ/AJX6DwsY49320bDcAAAAAElFTkSuQmCC" alt="" />

  可以看出参数是按照顺序传递进去的,这种写法就叫普通函数。

  但是这里有一个问题:

def test(a,b,c):
print a
print b
print c
test(1,2)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAe8AAABpCAIAAACcdTzrAAASOElEQVR4nO2dz5HEKpKH8WbWBExYRwovRm3BcKvTWw90fRwmYg51GwtexcbIgi0n2IMAAZkgpJLU1fTvi46KbjV/khSkUikVKSwAAICfj/huAQAAABzAG9Z8ekj5mN4V4KnEIMRo3m2H4/MlvAYzigP0cEhfLy3rynyqdVW3lPkOWvV8+Iw6VCHnzZYr5+GvpGTN51X3JcSXUM9ymbuOTo5Rvor4Uhsm1665OD2kGNK+IpndpMkl3MunmY+Ws5MUVsadHWXspO9tFXcK5k9HSWl1Zb70bXXBt5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I6hJm0FreN5dkUEvvwTePnwfSsa/OBDJqGT0bLN5RFbXBlKFHjBqK1rwyDytnuUXPblBhJpSyFfIjrR80Kn0xpnEUyIwIHCVr7hO5ZUsxsWhmFPIua3HY/A3FKHpIw5eJrSRxc6ZMawjihDx2ttEhIu3MAVN5G6UYpP63ctp7aZlFS9ckpF3FtULIIombZ73HDwkixSYyB6cyVz65tiXkTnet2CzP3/9W7Ch72dG9Aq/UKMTf5X99CTEqFT5dXaKNeAYO0cVss56ttctMMHy2wrJC4ocE+TMM+s5iyyjgmAPPtm8PReFd+yujdfguqCOdCedRD4x8I5smwHmj+O3zEMQ0WnMz5n6E87t3PZkEPxdmJpxK8ebgR9HHKMCHg2/2AwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD8CaAwBAD/w/064UKNLdmZ4AAAAASUVORK5CYII=" alt="" />

  本来要传3个参数的,但是我仅传了2个,这样就报错了。但我不想这样,我希望当我不传参数的时候,参数有一个默认的值,此时就需要默认参数了。

2.默认参数

def test(a,b,c=3):
print a
print b
print c
test(1,2)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAawAAABRCAIAAAAB0QWIAAAGtklEQVR4nO3dy5WjOBSAYYVFCJNIKQwqgtbOm5nJgG1p7yjYkIGTYBa89AbbQHm4/3fm9OmqFkLPixDYo/4GAMFUDwCCEQQBiEYQBCDaG0Gwu1fVvXu3AK1WtVKNfTeflM8v4Tlso3Zoh13O9TBVuTFbvd7UW9L8hq3tvPuI2rVBjhstZ47DZ+SC4DBYv5X6VrrNp7kZp05WT4eob/1En7zUhd29UrV/LqfMY1uHJXzVp826Lb3jJdZ27B1t+87cth34YsGm7sg1WrkxH+ZrdZ5sSXM+t+6r9h1RD1PtldtTtfiQnN+VDoKduVXm0fd937c6H7ydZP2YeOja7l4V+7gzd+dfXxgQz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Ufgpvn3r+XS8Z3a9kqWcGymqpp2Cg4s4TzPfd7uzHy/06b2BMsvJ631TuphZbgLlnzVxj27sxHjtE90VHoZ6O2W2n5aeelGq1pVf6Zds/FPZyMs3FP2WjVMk6mF24PpWsx7lM1XVTvvVNWp1nD3BP18Uu1sdWP7h7XOucI+bY1pjTcO/ZGZK3N6v9jv+nj8TLklOjHdg6k0Yc6Z0XtazukL25bZHdrlEyPxwtWTukU92VzC3FLx10u4rzPfyfrc97+Ot2PdV+/18tbeSFtzmXcDX5zdh35srl2eznyG8TGit3L8rBJCpmhkbjFvpe3yiYD/vZdnN58dBiAaQRCAaARBAKIRBAGIRhAEIBpBEIBoBEEAohEEAYhGEAQgWikIWs0nKQBcXCYIWq2UUoogCODiCitBqwmCAK6OIAhANIIgANEIggBEIwgCEK38dJgnxAAujpelAYhGEAQgGkEQgGgEQQCiEQQBiEYQBCAaQRCAaARBAKIRBAGIRhAEIBpBEIBomSDYmYrPDgMQIB0EzZfphr9ZTRgEcGHpIOh8iRZfqAXgylb2BDtTVdOiEACupxQEiYAALi8bBK1WREAAl5cOgp2p5o3Azhj2BAFcVe7BiIMFIYDr4mVpAKIRBAGIRhAEIBpBEIBoBEEAohEEAYhGEAQgGkEQgGgEQQCiEQQBiEYQBCBaJgja5dPDfKUqgAvLfIHC/KUJnakIgwCua+12mG/XB3BphSBoNTfDAK6OlSAA0VafDhMFAVzZ2oMR/lcjAC5t9RUZloEAroyXpQGIRhAEIBpBEIBoBEEAohEEAYhGEAQgGkEQgGgEQQCiEQQBiEYQBCAaQRCAaP8BsC5iHOfZTOMAAAAASUVORK5CYII=" alt="" />

  传参就相当于为形参赋上实参的值,你给了参数,我就按顺序执行 a = 1 ,b = 2,但此时c已经赋值为3了,所以就算不传,参数的数量也够了。

  当然也可以将参数传够, text(1,2,3) 就相当于为c重新赋值了。这样就能达到你传了参数就按照传的参数来处理,而没传就按默认的值处理

  所以我们可以为全部的参数都设置默认值。

  但是可能会出现这样的情况:

def test(a=1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56kSZd7Wk79GDPztLq3t3BlzimYbAkFGfQvwmfv1TiJtQDy3jHnHcaR/52R5hJ+b0WGMn3H0Mx8+5w0XU3+Qb5vSRWpqldg60FYVkJk1lr/tN56wUZ5+Myv0r/OHrmW2nv3xeSyG5pp9c1H/y0v+n5U3Iu3RbDnbrp6uG/Kkz5ESZLhtE6jMo9SnEoMKuuORkGhb04JoeBLb3jpNRiX2Jy3y/BjdDtCy13e/pTvLTQ6ox2ymO+qRmKEc8/SY51yTurLwhqktbwUsmLS3Yds4Ke6YA3Xt/g0fDn1ZAtNoq/W+3fXX4XWtXz0hoV3KGar6n7WWuefPZUalxMuNUE0JBD27owZ+dpThpdu2K1967nqxRcSfjnhHDbF3st5enWdzO9j3Drj1w++mZCT1F8ON++ZyVUj9HzcOG5Ejweu7lcQNhHoaLXKNdnXVuKK34uKrtJJdRd62H0pky5GSaWmXQg901/OnpvuOUeQfFAyJN7Rc2MbvOq9H9LuQER7Vn2LGe4yGWtCG5wyddd84K1U80B81zrgo919tFJTNtp2LVrToPmXNfOkZCs5KOY3zS2VIMOhPCnUxTgB6063vwZ2fBksagUnENjycgucvaTZkYwbGWOe0jOdvjt39//OWWJya4DOVTUEmAhoZsskM7SJyUO9ijbV4rrSBRJK6lVNimc1bI2Sfu8UMvJ43NJU3jT1Vh6jNr/hdWSKY3f8BULP03+a/PJOYY82bt6h4JBaw26nHJOQ2vDea8bjXaaTSluro0hh7s7EGw+cn8UcHbfyewlPvuoAefzFpLaobkogfehoq7BL4N6MHngrdFAQBgL7CkAACwF1hSAADYCywpAADsBZYUAAD2AksKAAB7gSUFAIC9wJICAMBeYEkBAGAv/wf0QlkhG6v4UAAAAABJRU5ErkJggg==" alt="" />

  并不允许这样的写法,因为这样没有默认值的参数很难处理,所以当默认参数和普通参数同时存在时,要将普通参数放在前面:

def test(b,a=1,c=3):
print a
print b
print c
test(1,2)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbcAAABRCAIAAADen3+XAAAGrEl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ASeU9bsIkgIuqu3vjjFq+B4ArqXwSiIkkgIviqXIAkBAlAUBClAQACVESACRESQCQECUBQEKUBAAJURIAJERJAJAQJQFAQpQEAAlREgAk/wGpN8PzlMPUvgAAAABJRU5ErkJggg==" alt="" />

  之所以要规定这样写,是因为要配合传参的方法:我们可以显式地规定哪个值是传给哪个参数的:

def test(b,a=1,c=3):
print a
print b
print c
test(a=1,b=2,c=3)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbkAAABHCAIAAAAV2a6iAAAGjUlEQVR4nO3dy3WkOBSAYYWlECYRKwwcwWhXq5kM2Fr7ioINGVQSzIKXnlxRBuwe/u/08Wm7hdCLiyQotxoAABL10wUAgD/AQbGyf2r97L+bS2dUo1TrjihR7PeX8BquVQe0wyHnelm93ZidkZu6Js1PqG3nw0fUoQ1y3mi5chwepCZWjmP6U6lPZbpymof1qu7MfIj6NDu67q2e7p9aNeG5vDJPXRKX8F2/7eKs6Z0gsXFT7xg39PZRd+CbBZu7o9Ro2435sh/i5VST5np+3UXHjqiX1UfltqsWvyTnE8mxsrcPbV/DMAxDZ8q3Ai/ZMCUeR0D/1JtDobdP71/fGDfe1eLa+Rbd2bnMbs4uKWGtb5fwRJW9M1lv5kstTquOP3Hon1plr42LGjPswXOPGoa9k6afH1H5moa1OLINz8v5THKs9KdjXvmSDo4XuZWxMsrnjXHjHxIfHjTom8vw75fwPK/a3pkSpxO9k6oTThxcq0xrMrPXaxrzvbO8Xba9k6YfH1HiaCml+W05n0uOlfVlciZqAn9dPH1r3Dj7+1Sq/Zr+Mv5ZL11rH0p9rnPAaYk9BoVpfydOMyZM5rY2TOCX0JlGqdaYZs7nihIGMkc9bB9uYAVpUntGTHAzz8TKddsknA9OZ5/bxE0/LB8Vn2ts9nBtOOamH1q1/9iHUg+tG6XbD91MLbacbi1w0qpxmlx5wh78KtRi2otY9nAy/V7VGmHdO6MaY1qlPo1py33amWAcJiOzdK50bKQNkqZZNqzGW1e2plEPiq2RHb3X5xw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vogOAjFgJADJiJQDIiJUAICNWAoCMWAkAMmIlAMiIlQAgI1YCgIxYCQAyYiUAyCpiZW81nwcHcG9yrLQfth//5gzREsA9ybHS+21s/GY2ADe1Y7+yt1rPU0wAuJXaWEmgBHBnVbHSGUWgBHBncqzsrV42KXtr2a8EcEM1z3Y8TC8B3BLvogOAjFgJADJiJQDIiJUAICNWAoCMWAkAMmIlAMiIlQAgI1YCgIxYCQAyYiUAyCpipVs/Ec5v+gVwTxW/O2P5fRm91URLALe0Zw3OfyEB4K4qY6UzrMAB3BjzSgCQ7XoOTrAEcFN7nu3w3+4AuKtd7wwxqQRwU7yLDgAyYiUAyIiVACD7Dzc9Ktz5uKGiAAAAAElFTkSuQmCC" alt="" />

  如果是这样的显式传参的话,传参的顺序是任意的。也就是 text(a=1,c=3,b=2) 也可以,反正最后赋值的结果是一样的。

  但是,如果是普通传参和显式传参配合使用时,就必须将默认传参放在开头: text(2,a=1,c=3,) 普通的按顺序传,显式可以不按顺序传。这也就是我们在写函数的时候要求普通的参数都放在前面,默认的参数都放在后面,就是为了和这里对应。

3.动态参数

  因为我们的函数最后可能并不是只有自己用,而是给用户或其他人调用,但是其他人不一定了解我这里接受多少个参数。

  传少了我们可以使用默认参数来解决,但是传多了怎么办,一旦传多了就报错用户体验就不好了,为了提高函数的适应能力,就出现了动态参数。

def test(a,*args,**kwargs):
print a
test(1,2,c=3)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAAAmCAIAAAAUQTbZAAAFoklEQVR4nO2bwZXrKgyGKcslvEaGMpwKHrus7uuA7bBPFd64gzThtzDYCATGia147vzfuWfOnQwWQhKykB01AQAAkEIdJml8dN1jfFfKoFWvlHVHaJRyfQ1lcFYdYIdD5nqarm7MQW+bumXMJ2i18+ERdahBzosWyTi8Eo05d94bN6VuSg/lMXcTmdDpcIm66R0h8FLEjI9O9XSuSGfv2lTDV7naJm/xDhmsnfeOdtNo7m0XvqhYcEfJaHVjPs3X5rZsGSNPvPZN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v4ZL8ROwsLUjDSD2stzg9kJ4L09+Jx/z3z3pjvHEtS1bDecC960KX50QNl7RCIZ215fA4cP3c+lt6W97hHqOnHUz2nbN49qiJFtknu4ovckmn202hrtRWq151/4aOp/8ZNTHT5wHEqumYwipiD/KrWPrL9qvro5cLe84acT+XyuHs7LR109O5aK7Up4MxgyFxSCOzpDPf66euz+MnSGOcyHuQG5NKLkSvmGT+Ptqyu6U57jsRK/kpgMCd94VZNCwVwh/X8Fgk34X8ve9dHrr2zYNzma1XM7f4a97JvejuPiPnlhjW54bXwD/gJnXxtTQEv5MsMltY2qCHfPHnx3PZ3S2ZcwEA4LeDnAsAAHIg5wIAgBzIuQAAIAdyLgAAyIGcCwAAciDnAgCAHMi5AAAgB3IuAADIsSPnOv3xb3AAAMDPpi3nOq2UUgo5FwAA3qK9znUaORcAAN4DORcAAORAzgUAADmQcwEAQA7kXAAAkGPXewt4dwEAAN4C34kAAAA5kHMBAEAO5FwAAJADORcAAORAzgUAADmQcwEAQA7kXAAAkAM5FwAA5EDOBQAAOf4HQXBBWjAxvR4AAAAASUVORK5CYII=" alt="" />

  这样函数的适应性就更高了,那么这里的 *args 和 **kwargs 分别是什么意思。

  我们先来看去是什么类型:

def test(a,*args,**kwargs):
print type(args),type(kwargs) test(1,2,c=3)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAe4AAAAzCAIAAADeonxEAAAHgElEQVR4nO2cy7WjOBCGFZZCmESuwsBnAhjtvOrJgO3V3lGwIQMnQS+Q0Kv0AANG9v+dPvf4IVSlkvgpCrnZBAAAoHHYux0AAADwKpByAABonpelfHxw/hhf7WUQrGOsV6/2Q3F9D89B9WyHOOxi6yl5PpiDKIe6ps07qI3z7itq14Act1rOXIffRF7K51PuxtiNiSHd5i6dmVHCHMJuYsXK2rQQxwdnnW/L8VmvmNDDrVxNO2pmx2sslJ4doaZR3usO3OiYmY5U0PLBfMqf4tle0+Z83LEX2XdFPSXfq7dVo7hIz99OTspHeefyOU3TNA0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BA80DKAQCgeSDlAADQPJByAABoHkg5AAA0D6QcAACaB1IOAADNAykHAIDmgZQDAEDzQMoBAKB5IOUAANA8kHIAAGgeSDkAADTPXzLCS8umQvWeAAAAAElFTkSuQmCC" alt="" />

  它们是元祖和字典,这里注意前面的*号只是表示这个是什么类型的,*表示元祖,**代表字典,而真正的变量名是*后面的。这里并没有规定一定要用args命名元祖,kwargs命名字典。但是这是个规范的写法,为的是让别的程序员能一眼看出这是个什么东西。

  接下来我们看看里面存的是什么:

def test(a,*args,**kwargs):
print args
print kwargs test(1,2,c=3)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAa8AAAA+CAIAAAATRAMEAAAG+UlEQVR4nO2dy5XrKBCGCUshTCJNGHIEl51XMxlo2+wdhTbKwEkwC/TgUUjYlmR75vvOPX1utxEUBfwqSg8rBwAAzql3GwAA8BGghgAAzj2jhsOtaW7Dq+32WrVKdfbVeiQ+38JzsJ3awQ+7tHU3zboze73t6poy76DWz7vPqF0dctxsOXMevkaihn7WXpS6KN0XDrmb5mqCzlk9HaIu+oHBeWosh1uj2ritwObR6amFz/Jpy69mdKLC2o6jo60bzLXuwCcNm4aj5LR1Z97Nz+aCqSlzPmHfN9l3Rt1Ns1dtD/XiQ2ren0gNB3NtzN0551yvy3IeFHNjYT/Gw61ZHezB3IJPn5gZwXqw3XSa7c1ks52qyyys5WULD6RydEaWE/Lci8O6E578h1ujxNl/kjPjETz2KOceDXzeP6Pknsa92NOHx9V8AJEahiFVYEE2hOlWtFINk3qemBnhIenhkcue3Cy/buFx3GtHZyycB2sHdSc++dtO6U4LEeg5znyuladtezTwefuM2pwtpTKfVvMhRGpY36rVSSfD3ev4q7Y+grso1f2O//H/lsVpzFWpyxLHjRthv+zHPEtaxhfM4lMTFwgttLpVqtO6neo5w8II4airGeJEUlQm55E5EZ2QBTVckhtxTDe2PvnEjn8sH5W25d0e7+B8bc21Ud3f5qrUtWla1XQ/TTt6bG5uMTjzalpGsicewd9CL8aMwZxpE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BpuZQaAb0ZSw1DaBtOokXW5e1hAAQA+CUENrZ6FL9gCW72hh8FhAABfR66GoaqV/i+CHALAF7OuhguDabZ2wqghAHwxVWpYIYXygQAA34KYN4ykz2pVdX2Ey8oA8M1I15QDOYwvLxvrPy5spRFDAPhe1u83tFoFjBop3UuDFgLAl/PosyhiCpFnUQDg6+E5ZQAA51BDAAAPaggA4BxqCADgQQ0BAJxDDQEAPKghAIBzqCEAgKf0LMr8dteadzHs9b6GoFkAgHMR1TB8UUPNO633e+/1YBrkEADeQUkNvSTVvMqr7nVfYiPCdwzwWjAAeA/rangc8XtyHnjDNgDAIRS+JWoHSarWtahg7dsUAQD2RXz39daljPmL9F7VTKktUocA8A6eiA3nj3fa1RIbAsAH8ETecPfU3kPfzAcAcAhPqOESOk7fDfAEwVWUKBxEDQHgPWzeb1j4PPxqgGKhrW+jz2+wIWkIAG9i81mUM+FZFAB4GzynDADgHGoIAOBBDQEAnEMNAQA8qCEAgHOoIQCABzUEAHAONQQA8KCGAADOoYYAAB7UEADAOef+BWwE/OJPAXOpAAAAAElFTkSuQmCC" alt="" />

  它将默认传参方式多传的值放在一个元祖里,而用显式传参多传的用其参数名为键,参数值为值,组成了字典。

  你可以无视它们,也可以将处理它们,赋值操作也好,循环也好,成员判断也好,各种需要看个人。


4.return

  当函数遇到return语句时,表示函数执行完毕,此时返回一个对象,然后销毁函数的执行环境。

  但是你在上面的示例中看到也有这样的写法:

def test():
print '我并没写return' test()

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbEAAAA5CAIAAAA3JoLnAAAG/UlEQVR4nO2dzZGrOBRGFRYhdCKtMHAEo51XMxmwtfaOgg0ZOAlmgUD/QmCg/V6fU6+6MBZXV1fSx5XA9cQIAAAz4qcdAAD4IA7VxOHZNM/hXSu9FK0QnT7Co5DP9/AadCcOiMMhdb1UUw5mL9dDXVPmJ6iN8+Ej6tCAnDdarhyH1dRr4jR2b0LchOzzZe7KaaKW8yXiJjd00a4eHZ6NaP26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cegAAAABJRU5ErkJggg==" alt="" />

  发现没有return语句还是能执行的,在调用的时候输出了东西,执行一遍后也停止了。

  注意,在函数内没有写return语句的时候,默认return的是一个空对象。也就是就算没写,python内部也做了处理。

  此时,有部分人分不清函数的输出和返回值的区别。

  这样说吧,在函数里print之类的操作能够输出内容,是因为虽然函数的执行环境是独立的,但代码还是有效的。外部能进行的操作,函数内部也可以。但是并不是所有的函数在执行完毕后都有如此明显的输出效果,此时我们需要查看函数是否成功,或者说我放了米进去,你操作一番之后总要把饭给我拿出来吧。

  这就是函数中return的意义。返回一个对象。这个对象可以是对执行状态的说明,也可以是处理后的结果等等。

def test():
'''一系列操作'''
return '搞定了' test()

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAa0AAABECAIAAAC9CP2eAAAIQ0lEQVR4nO2by3XEKhKGCYsQJhETBh3BsNPqTgZszV5RaEMGSkKzEEg8CkSrpXb35f+Oj48t8ygK+CmqZbYAAEDfsL82AAAA/hjoIACgd07poB05H+2rXU+CSca0ebUdis+38D0YzS7wwyV9zYrXnTmJY1e3lPkLWv18+Yq61CH3rZZ3rsNT5Dq4rtcHYw8mpkKtWfFBBcMywldhD/HEtJyaRTtyJuO+Apudu1MLz/JpG69ldqLCwrjZEWaxamireNIwPx0lp9WdOaufw63SUub9hGM/5NoVNSt+VWtPjeJDWr6MVAetGrial2VZlkmUJTwotrjC6+zakVen2aox+OuJNRHsBKP90Topb7PxzWUWtvKyhTfSODuO/RDeRnHbcMID346ckev+Tc6MZ/DeWsvybLDz9yuKHmk8iit9eF/L15HqYBhGBX1nk5dePBt1MGnnxJoIq6TVI2edvBq/buF9zK2z4wrnAdpNw4kPfKOZ0IKIOt/jzHO9nLbt2WDnz1fU4Woplfm0lq8k1cH2/oxIhhfeVd2vwqxR24Mx/et+WL/2banUwNhjj93ctXfd8C6fkpZZC2YxqYoLhBYaIRnTQkjfzjssjCBqDcrGCaOoTM4zqyE6hAkd3FMZcRznevc+Me5huVba1+r2+L62tsYH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IDegQ4CAHrn/5zIMxJZg67XAAAAAElFTkSuQmCC" alt="" />

  但运行还是没看到东西。

  那是因为函数虽然返回了对象,但是这个对象还在内存中,你并没有把它拿出了,当然什么也看不到。

print test()

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAccAAAAvCAIAAAAZ/pa+AAAGLElEQVR4nO2cy5WrOBCGFRYhTCKtMHAEw86bmcmAbWvvKNiQgZNgFrz0KAlBC+z2/b4zp89tW0ilUumnVNCj/gEAgHKoAQAAyoGqAgCUBFUFAChJOVXtH1X16H/aS6dVrVRrSljk8/4WXoNpVQE/FBnr2VRpZ3Z629U5bV5Brp+LR1RRh5wXLVfG4bVkquoY/Telbkp38Tb3xnKS0fMl6qZ3LPKhmOgflardsSybp8XzLTzKu23jnNVxGmszrY42Q9/c8y48aNi8HDGnpZ35bL42N15Om+ux575J2Yh6NlWp3nbN4k16fj1Zqto396p5DsMwDJ2O316sZsPUeIyV/lElg6ZvHta3ByLM2lemnW/7XTPbbObuAgtz+bGFJ5K5OhNrgrDM4rTp2MlI/6iUuIsucqa7gudeNQx7E7HXR5Q8U3cWJX14Xs9vQJaq2imeNZMgFPwjdqaqev0ciDD7Ev9yx/UHiwA/t/A8nrmrMzUOk8eTpuMmI6ZVutVCRnyNM4+Ncti2vYnYyyNqM1pibd6t57cgS1XzrTfac5Z9Kp9+1WbMKG9Ktd/TP8b/1k3eNHelbmteOR3wR/mY6lB+m7FhkC83bgPbQqNrpVqt67mfKyx0EK66N71baHPahOyJLSdBEFR1Ldq4OeY0+uwTM30Yv8ofa3S7ezIde6vulWr/be5K3auqVlX7VdWTx5bhVoMDr/ptJHvcFfyOzGKqhCwVJGHds7zhzr3Tqta6VeqmdRtf0047cRhEZmysMDZCh4RtlnLZeJMTZ+qt4KY3xOi9vmc/DDZ290miXFhVB9NaFbpww69HVNOE23v5tZ69MH4+p2Nrphm2GQbxgG8evhj5FtbauD2faaHLkmYug466YxcKwzYe+aoaSxASSWs4eqdVrcQTSWqs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HU+f0rmql7FuvgOwWRwAAPiNIGoAACVBVQEASoKqAgCUBFUFACgJqgoAUBJUFQCgJKgqAEBJUFUAgJKgqgAAJUFVAQBKgqoCAJQEVQUAKAmqCgBQkv8B70MgRm6m9i0AAAAASUVORK5CYII=" alt="" />

  这样就看到了,当然你可以进行变量的赋值,如 a = test() ,之后调用变量a就行了。当然返回结果多用True和False代表成功和失败,然后可以和条件控制语句配合使用。

def test():
'''一系列操作''' print test()

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAa8AAAArCAIAAABAX5AsAAAGFklEQVR4nO2dzZXrKgzHVRYlvEaGMpwKHrus7uvA22GfKryhgzSht8DYfAhMEtuTzP3/zj0zmQSDkIQQsnMuMQAAAGb6aQEAAOAteDkauptSN/dqL5OmgWi0r/Yj8f4SnoMdaQc97DLW3ai2Mie9reqeNj9Br55396hdFXKct5zphw/Sjobeay9EF9JTvc3VRJOzOlxCF/2AcZ6ypbspGtKxIplnpecSPsu7Lb8e6ySNtZ2toy07c+278EnBgjlqSmsr826+NhdMT5vziee+yb4edTdqr94emsWb9LwDrWjozFWZOzMzT7oezqNmPDf2NnY31TS2M7fo0yc8I1oPdgzb7GSCzDZ0V0jYy8sSHkindWbWDXmZxWHTiTd/d1Mkev9JykwteOxVzI8mPj/vUfJM01nsqcPjet6DVjSMU6pIgsKE+VG0Mxpm/TzhGfEl+eWJyp48LL8u4XHce60zNy6TtYOmk27+diQ9aiEDPUeZz43ytGyPJj4/7lGb3lJr824970MrGvaPanU2yfj0Ov+prc/gLkTj9/zC/1sXpzFXosuax80HYb/s5zpL3sY3LPJTkzaIJbR6IBq1HkI/Z0iYIFx1NS4tJCVtSh7xiWRDFqLhWtxIc7p59KATO79Zvyofy6s9PcH53tRV0fjHXImuSg2kxi81zBpbhlsFLrSat5HkSS34XZnFXDFYKi2C3bu0kc590jRoPRJdtB7rNp104oeFZ9bGKn2jVEjZZikr+c1JnGlmwU1tiN57fs+5G2ys7trC2Scash2jClS5UNejnD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0xIRo6o5Rx628fEJVxUf64fGY14iEA4EPoiYbOfCk1R7ol5LVfLOB8DQD4DHqioT/4NnLDLBqun7FzyA0BAB9B+3+JCg/WOKNadUMibcNLbdc2SA0BAB8Dnr4GAABmREMAAPAgGgIAADOiIQAAeBANAQCAGdEQAAA8iIYAAMCMaAgAAB5EQwAAYEY0BAAAD6IhAAAwIxoCAIAH0RAAAJiZ/wfEB8jkzyj5GwAAAABJRU5ErkJggg==" alt="" />

  当然不写就默认返回空对象None了。

def test(a,b):
c = a + b
return c print test(1,2)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAAjCAIAAAB6qcgkAAAFkklEQVR4nO2czXXsKgzHKYsSXiOhDE8Fj51X93XANuynCm/cwTThtzDYCAnMeGxncuf/O/fk3Ez4EJIQQnaiph2Md63v456eKYNRnVLOvzqOxPtLeA3eqQP0cMhcD6vryhzMtqpb2vwErXo+3KMOVch53nKlH76GYp/MjntT6qbMUOj1sLq3yfq8iV3UzTxhn13mHO9adXSuROag91zCvbzbDmyxDmlsfLCO8dNo+7aOOwWL5igpra7Mh/3a3DMtba4nXfsmx3rUw+qjRntqFW8y8vHkAXG0vbaPaZqmaTDloJ40m0Lj2czjXVftPdp78tMdzpFsCe/iYTvYKLOPwzEJW3lZwhNptE5gPZaXVZy2nDQFGO9aiRvgImVSC57ba5qeTX9+3qPkldJVHKnD80Y+gTwgpolVIgSzYn4nbQyI2Tg7nCPtkncnWtt5a35dwvN4tFonNOYp20nLoSmAd8o4I+Sh1yhz3yy7ZXs2/flxj9r0llKbdxv5FPKA2D6xN9k602ts+Nb4OY+7KeW+w3/mf+v+tLZX6rZmc+FGPO/8UHPJ28wNWZZqaYNUQm86pZwxXRznCgkJQq/ejrSoRNpwnnELciwLAXGtctDMLswedeLDh+Ve+Vyz2ulVbh5N91q5P7ZXqte6U9p96S5obJluFZhpNW8jyUMt+F1YRSgdLCUXwe5N2qBrH4zqjHFK3YxxZZsOhvgh88zSXNw3uEJ4m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QwQAgEDlKTMiIgDgsyg/VPFGafyxNQDAB1F57QbpIQDgs8CL2QAAEEBABACAAAIiAAAEEBABACCAgAgAAAEERAAACCAgAgBA4H/yUnCkmXvMvgAAAABJRU5ErkJggg==" alt="" />

  返回处理后的结果也是可以的,反正看个人需求。

  最后,虽说遇到return代表函数结束,但并意味着一个函数里面只有一个return。

def test(a,b):
if a != 0:
return a + b
return 'a不能为0' print test(1,2)
print test(0,2)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAasAAAAzCAIAAACmMbCgAAAGrElEQVR4nO2dzZXrKBCFKyxCmESaMOQIhp1XMxlo+9g7Cm2UgZNgFgIJigJhWVJ7rPudd3zUbn6KAi4FUuuR28b4UOoxbsw8M2jqiHr7bjkSn2/hOdiedvDDLnU9jao7c9Drrm5J8xu0+nn3EbWrQ44bLWeOw1cg6ctppN6IbqSHQsanUXcTNcjqkIVu+oUO2dR/40NRl9YV2ewdzS3cyqdNuZbeSRJr63tHWzeae1vGjYaF7ig5re7Mp/lZnSQtac4nbvsq+46op1F7lfZSKz6k5HcRFHA0d2WezjnnBl2W7SiZ84mnfh0fqtrBo3lEv90wGqI5YPuwnA4m2GxDcZmFrbxt4YE09o5nWXjnVhzWnHiRHx+KxBF/kjPTHjw2l3OvBji/P6Lklqat2NOHx5X8NoICxqFTVGvWbXyb2aiArJwNoyHOwrMnbtq4EX7fwuN4tvaOT5wHZQc1J13kbU+610KkeY4zt9Wy2bZXA5xfH1Gro6WU5tNK3gFBAdtrspo1LN6Z+h+1nSK1G1H/x19M/5YJacyd6LbEa36TO011f27C00wJszjUpAliC63uiHqtu1DOGRYmCLnuZkwPhpI0Oa+Mg2ThFRRwObhIYzdfe/CJ9V+Wc/G6Jrenu7OpNHVX1P9j7kR3pTpS/Y/qvMfm6haDM6/yNJI9aQ/+KbTCnwbMpyhCvzd5I237oKnTuie6ad2X+3TQyTjMRmaprnxs5A7J08xHRtOCJLaU9eCqN8TRe37JfBiszG4x41sK6GwfnSj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ABAQDXBQoIALguUEAAwHWBAgIArgsUEABwXaCAAIDrAgUEAFyXnRWQiPLr+MtKegAAOJkmAaI15mTxRfzJShOvAQDgZDYKkKhrTBNjcSxllxKMRhER4aUMAICj2U0B62liyavHkqNR/n0MVkMDAQCHskUBK5Fdvi9m31TKISLnRqOil3NBAgEARyJrWdiICq/Hije5+a/YxUrdggLG72TF+1kBAMciStUsPVyDmPblEsbOAWsVZ2mggACAkymIlPSSVFH4Sod9pfSlxA67YADA6VRjwPD/BbODPGn36i/yGHD1BJBJIe6EAABOoxoDqp8fJTyVUrkTEl+wWyLN2fE0DADgJHa+FxxfVAK9l4oFAICD2F8BK0/DlHbEpcdlAADgUKA7AIDrAgUEAFyX/wAAyGSjhuxUKAAAAABJRU5ErkJggg==" alt="" />

  可以配合条件控制语句实现不同情况返回不同的对象,这样就函数就能处理更多的情况了。


匿名函数:

  有些情况下,我只想用函数处理一下很简单的业务,这个时候完整地写一个函数感觉会增大代码量,此时可以使用匿名函数进行处理。

  python 使用 lambda 来创建匿名函数:

  1.lambda只是一个表达式,函数体比def简单很多。

  2.lambda的主体是一个表达式,而不是一个代码块。仅仅能在lambda表达式中封装有限的逻辑进去。

  3.lambda函数拥有自己的命名空间,且不能访问自有参数列表之外或全局命名空间里的参数。

  4.虽然lambda函数看起来只能写一行,却不等同于C或C++的内联函数,后者的目的是调用小函数时不占用栈内存从而增加运行效率。

语法:

lambda [arg1 [,arg2,.....argn]]:expression

示例:

# 可写函数说明
sum = lambda arg1, arg2: arg1 + arg2 # 调用sum函数
print "相加后的值为 : ", sum( 10, 20 )
print "相加后的值为 : ", sum( 20, 20 )

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAALMAAAAzCAIAAABTxq58AAAFIElEQVR4nO1bzZnjIAxVWS5hGxnKcDrgltt24OtwTxW5uIM0wR4MGJCQBTHzs+Z9c0iIUJ7R4wGOB+xZWB/T9FjfzfJUMAMs5gxGOX4+w6+BWUAwDiBL9tLTDHADuIF6lmPu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V3qjtMHLdHehh+6H5n6gMxjNKCmCVUe//+6k1ehr1CqdWF3pUDH7JOEyCu7zpGUz5u60m/w9O84ys5GQXiR+UYjKhkDLKFEZeAim4AYwxRgM0hjIGaAxlDNAYyhigMZQxQGMoY4DGUMYAjZb7GW/G4C74HgP/Fjd24nZlnHkP1IorxNzlJJMwYaU7XbjjUEYVev2iFt7WqoesMdlS4iCk3QHxDy7X+N0kKwxZFXLiklU5VAbOjD8lRYMlyEBy4VWIH9257m+tTDHiFyVlMNXCkZhD3E4GMOT5MGtt47M2RoFSvuOVns8QFkOoDP6LStlKLyRmUKOMBmzlD5K6zDNdNj1B9FYG40aMRJjkpBsxHGphVCaIyygDV4WvH9kFZ5OsJgyHQzIlVvZkZUT/bQIAAB+fV1pNbOXZRKIMMj8/sxs8g6F3NnZ7uO4O9LD90PxPVAbjGSUFsMpo8n9/SvXn1GucWl3oUTFIZZRicBLc5U3PYMrfxzP+K5zmGVnJyS4SPyjFZEIhZZQpjLwEUnADGGOMBmgMZQzQ+Aeu/qAFPAls9QAAAABJRU5ErkJggg==" alt="" />

  虽说是匿名函数,但是还是需要将其赋给一个变量,否则无法调用。而匿名函数里面的变量也是局部变量,和完整的函数也没有什么区别。

  匿名函数建议只在处理简单功能的时候使用,太过复杂的还是使用完整的函数吧。


pass语句

  Python pass是空语句,是为了保持程序结构的完整性。pass 不做任何事情,一般用做占位语句。

def test():
pass #我想要用这个函数处理某些事,但我暂时没想好怎么写,就先占个坑

  当然,不仅函数可以使用,流程控制中也可以使用。

if a <= 10:
pass
else:
print 'a大于10'

  还是那句话,仅起占位的作用。但对于某些语法结构来说,必须要有子语句的存在,所以pass在这个时候就很有用了。

  另外,pass也表示什么都不做。


  关于自定义函数就先说到这里,如有什么错误和需要补充的后面会相应修改。

上一篇:libevent 多线程


下一篇:Bugku-CTF社工篇之密码