栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

什么是python函数重载_Python函数的概念?

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

什么是python函数重载_Python函数的概念?

What are Functions?

Functions are simply pre-written codes that perform a certain task. For an analogy, think of the mathematical functions available in MS Excel. To add numbers, we can use the sum() function and type sum(A1:A5) instead of typing A1+A2+A3+A4+A5.

函数是预先写好的代码,用于执行某项任务。做个类比,在MS Excel中,我们使用sum()函数可以把数字相加。

Depending on how the function is written, whether it is part of a class (a class is a concept in object-oriented programming) and how you import it, we can call a function simply by typing the name of the function or by using the dot notation. Some functions require us to pass data in for them to perform their tasks. These data are known as parameters and we pass them to the function by enclosing their values in parenthesis ( ) separated by commas.

取决于这个函数是否为类的一部分以及调用方式,我们可以通过如下方式使用一个函数:函数名加圆括号,圆括号中传入参数,如果多个参数,用逗号隔开。

For instance, to use the print() function for displaying text on the screen, we call it by typing print(“Hello World”) where print is the name of the function and “Hello World”is the parameter.

举个栗子,print函数,print(“Hello World”),print是函数名,Hello World是参数。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/783104.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号