今日学习记录:

函数部分:


编程分类:

1、面向对象————类——class

2、面向过程————过程——def

3、函数式编程————函数——def(比前两个早了十年)

以Python举例说明:
#! /usr/bin/env python
#函数
def test1():#定义函数和函数名字,括号里是变量
    "xxxxxxxxx"#描述
    x+=1#过程,可以写N多行
    return 0
#过程
def test2():
    "xxxxxxx"
    x+=1
#过程和函数类似,就是没有返回的函数,但是在python中,过程最终会返回None
#函数调用
x= test1()
y= test2()

#函数的应用

一般应用于多次复用的时候,定义一个函数,第一可以做到多次复用,第二修改一次,多处生效。