Python知识学习11——函数 发表于 2018-07-08 | 分类于 程序人生 > Python > Python基础 本文字数: 2.2k | 阅读时长 ≈ 2 分钟 函数可以将代码模块化,便于代码的维护和管理,提高代码的复用性,同时也可以降低代码的耦合程度。 函数在定义之后需要调用才会运行。 这里介绍一下Python当中的函数的定义和调用: 1234567891011121314151617181920212223242526272829303132def print_fozu(): print(" _ooOoo_ ") print(" o8888888o ") print(" 88 . 88 ") print(" (| -_- |) ") print(" O\\ = /O ") print(" ____/`---'\\____ ") print(" . ' \\| |// `. ") print(" / \\||| : |||// \\ ") print(" / _||||| -:- |||||- \\ ") print(" | | \\\\\\ - /// | | ") print(" | \\_| ''\\---/'' | | ") print(" \\ .-\\__ `-` ___/-. / ") print(" ___`. .' /--.--\\ `. . __ ") print(" ."" '< `.___\\_<|>_/___.' >'"". ") print(" | | : `- \\`.;`\\ _ /`;.`/ - ` : | | ") print(" \\ \\ `-. \\_ __\\ /__ _/ .-` / / ") print(" ======`-.____`-.___\\_____/___.-`____.-'====== ") print(" `=---=' ") print(" ") print(" ............................................. ") print(" 佛祖镇楼 BUG辟邪 ") print(" Zen of python: ") print(" Beautiful is better than ugly.; ") print(" Explicit is better than implicit. ") print(" Simple is better than complex. ") print(" Complex is better than complicated. ") print(" Flat is better than nested. ") print(" Sparse is better than dense. ") print(" Readability counts. ") print(" Now is better than never. ")print_fozu()