官术网_书友最值得收藏!

Functions

A function is a set of statements that perform a specific task. Using functions helps in breaking our program into smaller parts. Programs will be more organized if we use functions as it avoids repetition and makes code reusable. Look at the following syntax:

def function_name(parameters):
statement(s)

Refer to the following example:

def welcome(name):
print("Hello " + name + ", Welcome to Python Programming !")

welcome("John")


Output:
Hello John, Welcome to Python Programming !
主站蜘蛛池模板: 武陟县| 阳信县| 岑溪市| 徐水县| 西充县| 永年县| 台安县| 连江县| 宁乡县| 石泉县| 宣武区| 绍兴县| 辛集市| 奉贤区| 黑河市| 伽师县| 连平县| 颍上县| 尼勒克县| 布尔津县| 外汇| 封丘县| 余江县| 永顺县| 宁武县| 梁平县| 阳原县| 金堂县| 方正县| 房产| 伊川县| 龙陵县| 稷山县| 无为县| 乳山市| 江安县| 延吉市| 衡阳县| 海门市| 呼玛县| 孝义市|